Skip to content

Instantly share code, notes, and snippets.

@seriald
Created August 17, 2018 12:14
Show Gist options
  • Save seriald/8cc7df7053ca5cf61d9465b4885cc9af to your computer and use it in GitHub Desktop.
Save seriald/8cc7df7053ca5cf61d9465b4885cc9af to your computer and use it in GitHub Desktop.
Export a list of users within an AD Group
$ad = Read-Host -Prompt 'Enter the AD Group'
$path = pwd
Clear-Content -Path "$path\Export\*"
$file = "$path\export\$ad.txt"
Get-ADGroupMember -Identity $ad | Out-File -FilePath $file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment