Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1060
  • Last Modified:

List of restricted senders to Exchange 2007 DL

Hi

Running Exchange 2007, I have a DL that is set to accept messages from only 20 people.

I would like to export that to a CSV file using Powershell. But if I do get-distributiongroup, I can't see this list as a field anywhere.

Does anyone know how I would do this?
0
kam_uk
Asked:
kam_uk
1 Solution
 
NagarajbCommented:
Not sure is this is what you are lokking for

Get-DistributionGroup "groupName" | fl Name, AcceptMessagesOnlyFrom
0
 
AkhaterCommented:
Get-DistributionGroup "groupName" | Select-object Name, AcceptMessagesOnlyFrom | export-csv c:\group.csv
0
 
GusGallowsCommented:
This is how I would do it (mostly for readability sake):

$out = "c:\output.txt" #put to the path\filename of where you want your output.

$grp = get-distributiongroup "groupname" #Put your group name between the quotes

#capture the group displayname for the header.
$grpName = $grp.DisplayName

#Put a header in the output
$inp = "Accept Messages only from the following for $grpName"
out-file $out -inputobject $inp

#list out all of the recipients who can send to the group
$list = $grp.AcceptMessagesOnlyFrom
foreach ($user in $list)
{
	$DN = $user.DistinguishedName
	$rec = get-recipient $DN
	$displayName = $rec.DisplayName
	out-file $out -inputobject $displayName -append
	
}

Open in new window

0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now