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