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/db4a867979a69dccd7f3192710d0f714 to your computer and use it in GitHub Desktop.
Save danjpadgett/db4a867979a69dccd7f3192710d0f714 to your computer and use it in GitHub Desktop.
get ad user info from list
ForEach ($user in $users) {
Get-ADUser -Filter{displayName -like $user} -Properties canonicalname | select name,samaccountname,enabled,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