0
votes

I have users and groups in the Users folder of a Windows 2012 Server. I want to check if a user is a member of a group and if not, add to the group. To list the members of a group, I've tried everything including:

get-adgroupmember -identity "cs99group"

which produces the error

get-adgroupmember : Cannot find an object with identity: 'cs99group' under: ...

The following works perfectly

get-adgroupmember -identity "Administrators"

Of course the Administrators group is in the Builtin folder and cs99group is in the Users folder. What am I doing wrong?

1

1 Answers

0
votes

Can you try with the parameter -recursive added?

Does the command Get-AdGroup work? If so, try Get-AdGroup "cs99group" | get-adgroupmember