POWERSHELL — Export members in a specific AD group to CSV

Sometimes we just need to know who is in a specific group and this code will grab an export of all Members in a Specific Group in AD and Export it to a CSV. 

Open up ISHE or Powershell for AD Code is: 

Get-ADGroupmember -identity "Public Group - Corporate Accounting"| select name | Export-CSV -path C:\temp\CorporateAccounting.csv

A Report for Members of Public Group – Production Lead in Spokane:

Get-ADGroupMember -Identity "Public Group - Production Lead - Spokane"| Export-Csv -path c:\report\testcsv.csv

The locations highlighted in pink are items that will need to be changed. 

After Get-ADGroupMember – add the group or public group that you want to extract the members for and for the export path just put whatever location you want the file saved at on your PC.