Solved

List of restricted senders to Exchange 2007 DL

Posted on 2011-03-21
3
937 Views
Last Modified: 2012-05-11
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
Comment
Question by:kam_uk
3 Comments
 
LVL 6

Expert Comment

by:Nagarajb
ID: 35186975
Not sure is this is what you are lokking for

Get-DistributionGroup "groupName" | fl Name, AcceptMessagesOnlyFrom
0
 
LVL 49

Accepted Solution

by:
Akhater earned 500 total points
ID: 35188592
Get-DistributionGroup "groupName" | Select-object Name, AcceptMessagesOnlyFrom | export-csv c:\group.csv
0
 
LVL 12

Expert Comment

by:GusGallows
ID: 35192776
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now