Get-ADGroupMember Output Formatting


I am using a script like below. I want to change output format like below.

$groups = Get-ADGroup -Filter "Name -like 'SSL_VPN_*'" foreach ($group in $groups) { Get-ADGroupMember -Identity $group | Select-Object Name | Export-CSV -Path "C:SSLVPN$($group.Name).csv" -NoTypeInformation -Encoding UTF8 } 

Also , it would be great if I get the users DisplayName as well would be sweet!

Desired output :

Group A Name | Group B Name Test User | Test User Test User 2 | Test User 3 

Thanks in advance,

submitted by /u/maxcoder88
[link] [comments]

Leave a Reply