Skip to content

Instantly share code, notes, and snippets.

@willm
Created February 10, 2017 13:39
Show Gist options
  • Save willm/621d69a938217664d7178b6169bb81d5 to your computer and use it in GitHub Desktop.
Save willm/621d69a938217664d7178b6169bb81d5 to your computer and use it in GitHub Desktop.
list AD groups for user
(New-Object System.DirectoryServices.DirectorySearcher("(&(objectCategory=User)(samAccountName=$($env:username)))")).FindOne().GetDirectoryEntry().memberOf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment