Hi guys,
I need to export group membership information into a CSV.
So far I have the following which is not working...
$ADGroups = Get-Content "Groups.txt"
ForEach ( $ADGroup in $ADGroups ) {
Get-ADGroupMember $ADGroup | Select-Object @{Name="FullName";Expression={(Get-ADGroupMember $_).Name}} | Export-Csv Test.csv - NoType
}The information I need in the CSV is GroupName($ADGroup), Name, SAMAccountName and DistinguishedName. Plenty of people asking about this on the internet but I am failing hard so hoping a fresh pair of eyes can highlight my downfall!
Thanks,