Get-ADGroupMember -identity "Applications" -recursive|
Where-Object {$_.distinguishedName -like "*OU=Apps,OU=Security*" }|
Select Name,SamAccountName |
Sort -Property Name |
Export-csv -path C:\Members.csv -NoTypeInformation
Purpose: I'm attempting to list users accounts who belong to a specific group but only those users from a specified OU.
The script above ran perfectly yesterday when I wrote it, producing exactly what I need. However, when I came into work today, and working in the same session of Powershell, I received the following:
Get-ADGroupMember : The size limit for this request was exceeded
At line:1 char:1
I then closed the session and attempted to run this script again but keep receiving the same error. I don't want to change the ADWS settings to extend the size, is there an alternative or some modification I can do to achieve the same result?
Please advise. Thanks.