Different tack..... exploration rather then answer. The PowerShell team tries hard to make cmdlet names 'discoverable' so the Exchange module is a snapin and has 2 elements so this will get all the Exchange cmdlets loaded Get-Command -Module Microsoft.Exchange.* or you can guess by the name distribution group Get-Command *distri* Get-Command *group*
Either way this will get you to two commands Get-DistributionGroup Get-DistributionGroupMember Using help to get examples and Get-member to see what is available help Get-DistributionGroup -examples # (turns out to be sort of useless on this command) Get-DistributionGroup 'some group' | Get-Member # (more useful) We see a managed by and Name property So now you have the main command (get-distributiongroup) and need to expand it. Yay foreach-object (alias % expands to foreach-object) and do similiar Get-Memeber for the Get-DistributionGroupMember Now Micheal's one liner is awesome and actually more useful then my quick try (you can pipe it to out-text) but I can't quite get there that fast yet. If the process is what caught you out, hopefully this will be helpful in a different way then his script. Link to cool ebook: http://powershell.com/cs/blogs/ebook/ Have fun, Steven Peck http://www.blkmtn.org On Wed, Aug 18, 2010 at 12:11 PM, Steven Peck <[email protected]> wrote: > No surprise, Micheals is better then mine. SO much for beating him :) > > On Wed, Aug 18, 2010 at 12:03 PM, Greg Olson <[email protected]>wrote: > >> Awesome, I will give this a shot. >> Thanks MBS! >> -Greg >> >> >> -----Original Message----- >> From: Michael B. Smith [mailto:[email protected]] >> Sent: Wednesday, August 18, 2010 12:01 PM >> To: NT System Admin Issues >> Subject: RE: Generating report for Exchange Distribution groups? >> >> Ehhhh. You might also need a couple of resultsize parameters there, >> depending on the size of your organization. (I just ran it at a larger >> customer of mine and ran into this.) >> >> get-distributiongroup -resultsize unlimited |% { >> $group = $_; >> "Name: $($group.Name), ManagedBy: $($group.ManagedBy), Identity: >> $($group.Identity)" >> $members = Get-DistributiongroupMember -identity $group.Identity >> -resultsize unlimited; >> foreach ($member in $members) { >> "`t$($member.Name)" >> } >> } >> >> Regards, >> >> Michael B. Smith >> Consultant and Exchange MVP >> http://TheEssentialExchange.com >> >> >> -----Original Message----- >> From: Michael B. Smith [mailto:[email protected]] >> Sent: Wednesday, August 18, 2010 2:55 PM >> To: NT System Admin Issues >> Subject: RE: Generating report for Exchange Distribution groups? >> >> [PS] C:\>get-distributiongroup |% { >> >> $group = $_; >> >> "Name: $($group.Name), ManagedBy: $($group.ManagedBy), Identity: >> $($group.Identity)" >> >> $members = Get-DistributiongroupMember -identity $group.Identity; >> >> foreach ($member in $members) { >> >> "`t$($member.Name)" >> >> } >> >> } >> >> >> Name: j-and-m, ManagedBy: smithcons.local/Users/Administrator, Identity: >> smithcons.local/Users/j-and-m >> Michael B. Smith >> Jacqui >> ... >> Etc. >> ... >> >> Regards, >> >> Michael B. Smith >> Consultant and Exchange MVP >> http://TheEssentialExchange.com >> >> >> -----Original Message----- >> From: Greg Olson [mailto:[email protected]] >> Sent: Wednesday, August 18, 2010 2:48 PM >> To: NT System Admin Issues >> Subject: Generating report for Exchange Distribution groups? >> >> All, >> Is there any way to generate a report that lists out all of our >> Distribution groups, along with the members and owners of the lists? I see >> how to generate a listing of the groups, but not a way to have it put the >> members of each group and the owners as well. >> I'm sure there is probably a PowerShell way of doing this, but my ps >> skills are weak and Google Fu is failing today. This is on Exchange 2007 >> and Outlook 2010. >> Thanks in advance for any help! >> -Greg >> >> >> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ < >> http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ >> >> >> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ < >> http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ >> >> >> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ < >> http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ >> >> >> ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ >> ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ >> >> > > > > > ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~
