Discover Circular AD Group Memberships

Posted on Posted in Active Directory, Powershell

Might as well have a recursive function in the first post eh?

I stumbled across this script to discover circular Active Directory group memberships but was inspired to get a more visual representation after reading the FAQ section.

Group membership details used for demonstration:

Script output comparison:


The script will pull in all AD groups in your domain, check for circular links using memberOf discovery, and then output results.  Due to the worst case scenario when dealing with circular group membership the script won’t discover all potential paths during the first pass.  Continue running until no circular groups are discovered.