hi friends
in my Active Directory, in default "Users" container, have created a group named "helpdesks". i have also some OUs and SubOus which each contains some users.
i need to get all users in my entire domain which are not member of helpdesks group.
Get-ADUser -SearchBase -Filter {memberof -notlike 'cn=helpdesks,cn=users,dc=mydomain,dc=lab' } | select name
Get-ADUser -SearchBase 'dc=mydomain,dc=lab' -searchscope subtree -Filter {memberof -notlike 'cn=helpdesks,cn=users,dc=mydomain,dc=lab' } | select name
but all commands get only these 3 accounts : administrator , Guest , krbtgt ( and not those accounts which are in ou-users , users-marketing subou & any other locations ) strange ! any idea thanks in advanced