Skip to content

Instantly share code, notes, and snippets.

@samurailink3
Last active March 5, 2020 22:04
Show Gist options
  • Save samurailink3/7136822 to your computer and use it in GitHub Desktop.
Save samurailink3/7136822 to your computer and use it in GitHub Desktop.
Get list of users from AD group and export to a file. File is roughly fixed-width, so use Excel to break up the data.
dsquery group "CN=Group Name,OU=Groups,DC=Example,DC=com" | dsget group -members | dsget user -ln -fn -samid -email > C:\Users\username\Desktop\file.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment