Skip to content

Instantly share code, notes, and snippets.

@jd-raymaker
Last active December 15, 2019 11:13
Show Gist options
  • Save jd-raymaker/b2ce9757dde0a57759b813a9daacc037 to your computer and use it in GitHub Desktop.
Save jd-raymaker/b2ce9757dde0a57759b813a9daacc037 to your computer and use it in GitHub Desktop.
Get all members from an AD group with name username and principal name
Get-ADGroupMember -Identity "AD Group Name" | ForEach-Object { Get-ADUser -Identity $_.SamAccountName | select name,SamAccountName,UserPrincipalName }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment