Powershell - Combine output of 2 cmdlets into CSV

This bit:
Code:
$SGProps5 = $SG.samaccountname | Select-Object @{Expression={$SG.Name};Label='Group Name'},@{Expression={@(Get-ADGroupMember -Identity $SG |Select -Expand Name) -join ';'};Label='Name'}
vs
Code:
$SGMembers = (Get-ADGroupMember -Identity $SG |Select -ExpandProperty Name) -join ';'
-join is just for when you want to combine multiple strings into a single string. In our case we had an array of strings that we wanted to convert to a single string, so only a single value has to be written to the excel cell


OK, I understand.

Cheers! I use to have scripts Id have to run seperately and then copy the CSV from one to another to have a complete report.

Now this works, I can merge the scripts together! :cool:
 
Back
Top Bottom