Skip to content

Instantly share code, notes, and snippets.

@gjyoung1974
Created May 12, 2020 17:18
Show Gist options
  • Save gjyoung1974/7ef2db7aa6448b386e0bd581fead2124 to your computer and use it in GitHub Desktop.
Save gjyoung1974/7ef2db7aa6448b386e0bd581fead2124 to your computer and use it in GitHub Desktop.
# Get enabled members of a given AD group
get-adgroupmember "some-group" |
where {$_.objectclass -eq 'user'} |
Get-ADUSer -properties Name,Mail |
Select Name,Mail, Enabled | Where-Object {$_.Enabled -like “True”} | export-csv -path "C:\users\gordon.young\Desktop\some-group-05122020.csv"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment