Sometimes we just need to know who is in a specific group in the event we’re doing a New Hire, Termination, Position Change, or some sort of Audit. This code will grab an export of all Members in a specific AD group and export the list to a CSV.
For identity just insert the name of the group you want to run the report on
For Export Csv just insert the path you want to save your report to
Get-ADGroupMember -Identity "Administrators"| Export-Csv -path c:\report\testcsv.csv