It doesn't work for a sub-domain because by default, Adaxes cmdlets, such as Get-AdmGroup or Add-AdmGroupMember, perform operations only in the current domain. To be able to perform operations with the help of the cmdlets in another domain, you need to specify the Active Directory Domain Services instance to connect to via the -Server parameter and the Adaxes service that will be used for the operation via the -AdaxesService parameter, for example:
$group = get-AdmGroup "KendoxUser_%adm-CustomAttributeText17%" -Properties Members -AdaxesService localhost -Server subdomain.example.com
We can modify the script to match your requirements, but for this purpose we need to know how to get the FQDN of the subdomain. Can it be hard-coded in the script or maybe derived from some properties of the user?