Not sure if I'm missing something here.
I tried the following:
$groupname = "atl-usercategory-itg_employees"
Get-OpenADGroup -Session $session -identity $groupname
and I get a response stating that it can't find the object using a filter that makes use of the distinguishedName property:
Cannot find an object with identity filter: '(&(objectCategory=group)(distinguishedName=atl-usercategory-itg_employees))'
If I change the group name by removing the _employees part at the end, it correctly searches via samAccountName
$groupname = "atl-usercategory-itg"
Get-OpenADGroup -Session $session -identity $groupname
It seems that when there's an underscore in the group name, it incorrectly switches to using distinguishedName.
Is there any way I can force it to use samAccountName, without writing out the ldap filter myself?