Skip to content

Instantly share code, notes, and snippets.

@kristianrl
Last active August 17, 2022 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristianrl/a14fbddb3e799f4ed3506e197acf5c2f to your computer and use it in GitHub Desktop.
Save kristianrl/a14fbddb3e799f4ed3506e197acf5c2f to your computer and use it in GitHub Desktop.
Compare two users' security group memberships using PowerShell
Compare-Object -ReferenceObject (get-aduser USER1 -Properties memberof | select -expand memberof | sort) -DifferenceObject (get-aduser USER2 -Properties memberof | select -expand memberof | sort) -IncludeEqual | sort SideIndicator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment