Powershell tip to get desired distribution group name and members in csv format
I'm trying to get a list of every distribution group and the DG Name (column 1) SEPARATOR- List-Of-All-DG-Member-Email-Addresses-Separated-With-Space (column 2). I'm using "Get-DistributionGroupMember -identity "DistributionListName"
| Export-Csv C:\MyFile.Csv", but I have hundreds of DL's and doing them one at a time is extremely tedious. I'm thinking a get-distributiongroup | get-distributiongroupmember | ft something | export-csv, but I'm not getting it right and could use assistance.
March 2nd, 2012 10:11pm
I once wrote a script to list all distribution groups and members of those groups. It uses the Add-Member method, which is slow compared to Select-Object. On the other hand, it allows for a structured approach which is easy to modify and extend.
See if that helps. (Not Karl Mitschke's script, whom I btw hold in high esteem for his PowerShell skills.)
Powershell command to list all distribution groups and members of those groups
http://social.technet.microsoft.com/Forums/en-SG/exchangesvradmin/thread/63ad55d1-1393-4533-8065-1d7cbd8657faMCTS: Messaging | MCSE: S+M
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2012 2:52am
you can try running following vbs script
http://messagingserversupport.com/2012/01/19/extracting-distribution-list-information-in-exchange/
Exchange Rocks
March 3rd, 2012 3:03am
Hello Kanien,
Any updates on this issue?
Thanks,
Evan Liu
TechNet Subscriber Supportin forum
If you have any feedback on our support, please contacttngfb@microsoft.com
Evan Liu
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
March 5th, 2012 8:50pm
Hey Evan,
I'm getting this error for every list but the first one:
Method invocation failed because [System.Management.Automation.PSObject] doesn't contain a method named 'op_Addition'.
At C:\Scripts\distribution_list.ps1:7 char:10
+ $Report+= <<<< Get-distributionGroupMember -identity $_.identity| select @{Name='Distribution Group'; Expression={[St
ring]::join(";", $GroupName)}}, Name, PrimarySmtpAddress}
+ CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
March 13th, 2012 11:57pm
Hello,
Any updates?
Thanks,
Evan Liu
TechNet Subscriber Supportin forum
If you have any feedback on our support, please contacttngfb@microsoft.comEvan Liu
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
March 17th, 2012 11:52pm
Even
I'm getting Unexpected token 'Report' in expression or statement. At line:1 char:44
What do you thinks?
June 1st, 2012 8:48am
Could you show me the exact error?
Thanks,
Evan
Evan Liu
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2012 8:49pm
This works great, but the long names are being cut off with three points. Is it possible to not cut them off?
July 31st, 2012 3:45am