I need help writing a script that will ask you for two domain users, then retrieve their groups, and only return the groups they’re not both a part of.

Essentially, this script is for my team and when and if we get new people, we’d like a quick way to see what group memberships they’re missing.

User 1 has 25 groups User 2 has 5 groups, but needs all of User 1’s groups

This script will quickly identify the difference in groups between these two users.

Ideally, then, a second script will add User 2 to those groups they’re missing.

Thanks in advance for the help!

I should note our DC is on Server 2008R2 running POSH 2 while I’m on Win 10 with POSH 5.

submitted by /u/gaspitsjesse
[link] [comments]

Leave a Reply