Question : Compare user security groups - Active Directory

Is there a script or program that can compare the groups two different Active Directory users are members of, and show/report the differences?

Answer : Compare user security groups - Active Directory

The attached code will do what you want, but you have to figure out how to read it
Output will look like this:

InputObject                             SideIndicator
-----------                             -------------
CN=Domain Users,CN=Users,DC=Student,... ==
CN=Domain Admins,CN=Users,DC=Student... =>
CN=Administrators,CN=Builtin,DC=Stud... <=
CN=Users,CN=Builtin,DC=Student,DC=Pi... <=
CN=KLAdmins,CN=Users,DC=Student,DC=P... <=

== means both users are members of that group
=> means the second user input is a member of that group and the first user isn't
<= means the first user is a member of that group, and the second user isn't.
1:
2:
3:
4:
5:
$user1 = Read-host "Enter first user name"
$user2 = Read-host "Enter second user name" 
$membership1 = get-adprincipalgroupmembership $user1
$membership2 = get-adprincipalgroupmembership $user2
compare-object $membership1 $membership2 -includeequal
Random Solutions  
 
programming4us programming4us