I would like to find a way (VB Script or PowerShell preferably) of generating a report which displays all user accounts on the domain, and displays the groups of which they are a member.
I would like this to be exported to a Excel spreadsheet in the following format:
Username1 | Group1, Group 2, Group 3, Group 4, Group 5 etc.
Username2 | Group1, Group 2, Group 3, Group 4, Group 5 etc.
I have been playing around with Quest Powershell Commands for AD and came up with the following:
get-qaduser * -sizelimit 0 | select Name,MemberOf | export-csv report.csv
However this displays in the output file as:
Username1 | System.String[]
Username2 | System.String[]
Username3 | System.String[]
Where System.String[] should be the group names.
What should I do?
Try this, you need to join the group names: