Dealing with large group memberships (range retrieval) using PowerShell (v1)

Posted on 2010-01-08
Last Modified: 2013-12-24
I'm working on a project where I need to have a script return the distinguished names of all members of a distribution group.  Easy enough, except when the distribution group has more then 1,500 members.  I know I can do this with non-native cmdlets or the Exchange cmdlets, but I really need to do this using LDAP\ADSI.  The problem appears to be that I need to use range retrieval, however I'm having a hard time finding working code samples that do this.  Does anyone have any code samples that can be used to spit out group member DN's for distribution groups that are larger than 1,500 members?

As always...thanks!
Question by:evetsleep
    LVL 70

    Accepted Solution



    MOW has an example of this in PowerShell here:

    Is that what you needed? I can think of a few other ways to do it, including skipping ADSI and going for DirectoryServices.Protocols instead, fair bit more complex though.

    LVL 1

    Author Closing Comment

    That was it...thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now