Always getting 1500 member of distribution list using PowerShell Always getting 1500 member of distribution list using PowerShell powershell powershell

Always getting 1500 member of distribution list using PowerShell


You need to change your code to use a DirectorySearcher approach, and check out the PageSize property of the DirectorySearcher

Setting that value to something (instead of leaving it 0) will start paged searching to allow AD to return more than 1500 members. It is recommended to set the PageSize to a sensible value like 500 or 1000 - if you set it too high (higher than the system limit of 1500), it will be ignored and won't work!

See some other blog posts on how to tackle this problem:


When retrieving a large attribute you need to ask for the values in it in batches. This is often called "ranged retrieval" in directory speak.Nearly every well behaving MSFT LDAP API supports this, including ADSI...http://msdn.microsoft.com/en-us/library/windows/desktop/ms676302(v=vs.85).aspx


This will work quite nicely, requires the active directory module

(Get-ADGroup $Group -Properties members).members