Always getting 1500 member of distribution list using PowerShell

前端 未结 3 1186
你的背包
你的背包 2021-01-14 14:23

I would like to get all members (mail address) of a certain distribution list. Currently I just recieve the first 1500 members. My Script looks like that:

         


        
3条回答
  •  情书的邮戳
    2021-01-14 15:00

    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:

    • Get more than 1500 members from an Active Directory group

    • List Members of Large Group

提交回复
热议问题