Verify all AD groups added to a domain user

Most important task when you join a new organization or when you start working for a new client is to gain access to all required AD groups. I had to switch several times and this was a pain point. My manager would share a list of AD groups and ask me to check if my account is added to all those groups across all domains. Hence being lazy, I had to make use of below simple script to fetch and compare lists quickly at each domain.

Store the script in a file and name it for example “groups.ps1”. Copy-paste all AD group names required for your job role into a separate text file named groups.txt in the same folder. Open a powershell prompt, Navigate into the directory and execute below command.

You could further customize the script based on your requirement.