Compare AD Groups

Not sure how I missed this in the past, or have not had this come up before, but here is something I just had to use today.

Comparing 2 AD Groups in Poweshell.

diff (Get-ADGroupMember "Group1") (Get-ADGroupMember "Group2") -Property 'SamAccountName' -IncludeEqual

You will get 2 columns:

SamAccountName SideIndicator

User (== or <= or =>

== in both

<= in first group

=> in Second group

Bookmark the permalink.

Comments are closed.