Ying Li at myITforum.com

PowerShell & System Center

PowerShell script to list group members in Active Directory

In my previous post, I listed user group membership in AD and now we will visit the other side of the street. Here is a powershell script to list target group members in Active Directory

$root=([ADSI]"").distinguishedName

# You can change Domain Admins to any group interested and of course modify the path
$Group = [ADSI]("LDAP://CN=Domain Admins, CN=Users,"+ $root)
$Group.member

Posted: Aug 28 2007, 09:56 AM by yli628 | with 2 comment(s)
Filed under:

Comments

TrueBlue said:

Great little script Ying. When I run it, it only returns the first 1500 members of the group.  Is there a way I can force AD to return all the members of the group?  Thanks

# June 27, 2008 4:22 PM

yli628 said:

TrueBlue,

Take a look at this link

myitforum.com/.../using-powershell-to-move-tsprofilepath-for-multiple-users-in-ad.aspx

You could use Quest AD extension. Get-QADGroup -sizelimet 0.

I am sure my method above should have a parameter similar. But my computer crashed today. I can't validate it.

Ying

# June 27, 2008 6:01 PM