配布リスト一覧の出力¶
$temp=foreach($i in Get-DistributionGroup){Get-DistributionGroupMember -Identity $i.PrimarySmtpAddress | Select @{n="GroupName";e={$i.DisplayName}},@{n="GroupType";e={$i.recipienttype}},DisplayName,PrimarySmtpAddress}
$temp | Export-Csv -Encoding UTF8 -NoTypeInformation -Path C:\temp\MLMember2.Csv
参考URL
https://it-bibouroku.hateblo.jp/entry/PSgroup
メンバー追加
Add-DistributionGroupMember -Identity GROUPNAME -member USERNAME