Export nested group structures with PowerShell

I got a request the other day for a script that can export members of nested Active Directory groups.

They wanted the export to be more or less in the same format as a file structure.

The results are therefor returned as strings in the following format:
Group \ SubGroup1 \ SubGroup2 \ User1 (SamAccountName)
Group \ SubGroup1 \ SubGroup2 \ User2 (SamAccountName)
Group \ SubGroup1 \ SubGroup2 \ User3 (SamAccountName)

and so on. I thought that someone else might try to achieve a similiar task so I uploaded the code here.

Also, I wrote a quick and simple GUI for this, which is available here, it looks like this:


The form makes it simpler for end users to use.

Both requires the Active Directory module and the GUI requires PowerShell v.3 or higher.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.