Hi there!
Complete newbie here - trying to figure out how to accomplish the following:
- Use an existing .csv list of all the user groups in AD I want to pull (in one column)
- Use grab each user group from the column
- Find that user group in AD
- Pull the member names
- Put those member names into its own column in a new .csv
- Rinse and repeat until all of those user groups have been found
- Export the .csv
$Groups = Get-Content -Path 'c:\Users\arielle.admin\Desktop\USERGROUPS.csv' foreach ($Group in $Groups) { Get-ADGroupMember -Identity $Group | Export-Csv -Path "c:\Users\arielle.admin\Desktop\$group.csv" }This was able to export each group into its own .csv, which was helpful, except it'd be so nice to be able to open up a single document and see all of my member names in its own column, and I couldn't specify that I only needed the "name" column.
Any advice would be greatly appreciated!! Thank you so much in advance.