Get-DistributionGroup command
Hi, I'd like to export a list of our distribution groups to a csv file, which are set to accept messages from "All Senders" under the Messaging Restriction Tab. Any idea how I do this in Exchange Powershell on Exchanger Server 2007? I'm thinking it's going to be the Get-DistributionGroup command. Thanks in advance
July 11th, 2011 5:04pm

On Mon, 11 Jul 2011 20:57:56 +0000, RhodanZ wrote: >I'd like to export a list of our distribution groups to a csv file, which are set to accept messages from "All Senders" under the Messaging Restriction Tab. Any idea how I do this in Exchange Powershell on Exchanger Server 2007? I'm thinking it's going to be the Get-DistributionGroup command. That may be more complicated than you think. To see what DLs accept messages from everyone, even if they use an anonymous connection to send the message, this would work: get-distributiongroup -resultsize unlimited | where { ` $_.AcceptMessagesOnlyFrom.count -eq "0" -and ` $_.AcceptMessagesOnlyFromDLMembers.count -eq "0" -and ` $_.RequireSenderAuthenticationEnabled -eq $false -and ` $_.RejectMessagesFrom.count -eq "0" -and ` $_.RejectMessagesFromDLMembers.count -eq "0" ` } --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2011 6:15pm

Thanks for the reply. I'm having a problem running the above, the Exchange shell changes to a >> prompt and nothing further happens?
July 11th, 2011 6:26pm

On Mon, 11 Jul 2011 22:19:54 +0000, RhodanZ wrote: >Thanks for the reply. I'm having a problem running the above, the Exchange shell changes to a >> prompt and nothing further happens? Remove the 'back-tick' characters and make it one long command. I tried reformatting the long command to fit the HTML format used by this forum. I guess I didn't do a good job. :-( Or try this. It works: get-distributiongroup -resultsize unlimited | where { ` $_.AcceptMessagesOnlyFrom.count -eq "0" ` -and $_.AcceptMessagesOnlyFromDLMembers.count -eq "0" ` -and $_.RequireSenderAuthenticationEnabled -eq $false ` -and $_.RejectMessagesFrom.count -eq "0" ` -and $_.RejectMessagesFromDLMembers.count -eq "0" ` } Remember that copy-and-paste from HTML to text doesn't always work the way you'd expect it to. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2011 10:41pm

Hi, > export a list of our distribution groups to a csv file get-distributiongroup -resultsize unlimited | where { ` $_.AcceptMessagesOnlyFrom.count -eq "0" ` -and $_.AcceptMessagesOnlyFromDLMembers.count -eq "0" ` -and $_.RequireSenderAuthenticationEnabled -eq $false ` -and $_.RejectMessagesFrom.count -eq "0" ` -and $_.RejectMessagesFromDLMembers.count -eq "0" ` } | Export-CSV -Path "C:\AllDistributionGroups.csv" Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
July 13th, 2011 2:25am

Hi As Rich Informed I run this shell command and it worked [PS] C:\Documents and Settings\Administrator.SSMTEST.000>get-distributiongroup -resultsize unlimited | where { $_.AcceptMessagesOnlyFrom.count -eq "0"} | Select name, grouptype, managedby| Export-CSV c:\test.csv I hope this is your requirment.
Free Windows Admin Tool Kit Click here and download it now
July 13th, 2011 3:12pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics