Skip to content

Instantly share code, notes, and snippets.

@danjpadgett
Last active December 6, 2016 15:05
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 danjpadgett/adbfc1b522b3bc9184b17f6b58eeea6e to your computer and use it in GitHub Desktop.
Save danjpadgett/adbfc1b522b3bc9184b17f6b58eeea6e to your computer and use it in GitHub Desktop.
Get AD user Info
Get-ADGroupMember "Domain Admins" | select name,samaccountname, @{Name='Enabled';Expression={(Get-ADUser $_.samaccountname).Enabled}},@{Name='Location';Expression={(Get-ADUser $_ -Properties * ).CanonicalName}},@{Name='Groups';Expression={(Get-ADPrincipalGroupMembership $_.samaccountname).name} -join ';'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment