I have the below script pulling the correct information, but need assistance formatting it. What I am looking for is a table that lists the Group names in Column A and the User names in Column B. The output right now lists the group names in Column A, but puts the user names all on one line in Column B.
This is what comes out:
Col A Col B
Group1 {User 1, User 2, User 3}
This is what I would like to see:
Col A Col B
Group 1 User 1
User 2
User 3
Here is the script I have thus far.
Get-QADGroup -Name '*Group Name*' | ForEach-Object {
$group = $_
$member = $group | Get-QADGroupMember -IncludedProperties samaccountname -UseDefaultExcludedProperties $true -SizeLimit 0
New-Object -TypeName PSObject -Property @{
Name = $group.Name
EID = $member
}
}