Error “Get-adgroupmember : The size limit for this request was exceeded”

Scenario:  You are trying to pull all members of a group into a variable and you receive this error:

Get-adgroupmember : The size limit for this request was exceeded

Solution:  Since the AD Group has a lot of members in it, running the command doesn’t work since it hit a PowerShell/AD Threshold.  Instead, run pull the members like this:

$group =[adsi]”LDAP://CN=ProdUsers,OU=Groups,DC=XYZ,DC=com”

$members = $group.psbase.invoke(“Members”) | foreach {$_.GetType().InvokeMember(“name”,’GetProperty’,$null,$_,$null)}

To display the results:

$members

$members.count

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: