Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Exporting Distribution Group Members

$
0
0

I am trying to run the following script but it gives me a message about Input being NULL.  What am I missing?

 

$report=foreach($i in Get-DistributionGroup | where {$_.Name -like '*equity*'}) {

  Get-DistributionGroupMember $i -ResultSize Unlimited |

    Select-Object @{n="Member";e={$_.Name}},

       @{n="Group";e={$i.Name}}

}

 

$report | Export-CSV c:\GroupMembers.csv -NoType


Viewing all articles
Browse latest Browse all 10624

Trending Articles