Add multiple domains to Blocked Senders in Exchange 2007

Is there a way to add a list of domains to Blocked Senders in Exchange 2007 without having to individually add them.  In other words, is there a way to import a list, either through the console or the Powershell, where the list could be edited outside Exchange and then imported.  I can easily cut and paste a list together but typing individual domain names/email addresses would take too much time.  Thanks.
LVL 4
rstorm1Asked:
Who is Participating?
 
halejr1Connect With a Mentor Commented:
Haven't tested it yet but plan on doing the same thing -- instructions below:

Run the install-AntispamAgents.ps1 script on the Edge server, you can find it in C:\Program Files\Microsoft\Exchange Server\Scripts.
Now restrat the Exchange Transport service for changes to take effect.

PS > Restart-Service MSExchangeTransport

You can see the installed agents in Exchange Managment Console under: Organization Configuration | Hub Transport | Anti-Spam (tab).
To import the blocked domain url's to the Sender Filtering agent:

# block messages that do not contain a sender.
Set-SenderFilterConfig -BlankSenderBlockingEnabled:$true


# block messages for a list of domains including their subdomains
# sample domain urls
example.com
virus.com

Set-SenderFilterConfig -BlockedDomainsAndSubdomains (Get-Content c:\blocked.txt)
Run the install-AntispamAgents.ps1 script on the Edge server, you can find it in C:\Program Files\Microsoft\Exchange Server\Scripts.
Now restrat the Exchange Transport service for changes to take effect.

PS > Restart-Service MSExchangeTransport

You can see the installed agents in Exchange Managment Console under: Organization Configuration | Hub Transport | Anti-Spam (tab).
To import the blocked domain url's to the Sender Filtering agent:

# block messages that do not contain a sender.
Set-SenderFilterConfig -BlankSenderBlockingEnabled:$true


# block messages for a list of domains including their subdomains
# sample domain urls
example.com
virus.com

Set-SenderFilterConfig -BlockedDomainsAndSubdomains (Get-Content c:\blocked.txt)



0
 
halejr1Commented:
sorry .. double posted.... ughhh!
0
 
rstorm1Author Commented:
Excellent, thanks.  Will try as soon as possible.
0
 
halejr1Commented:
rstorm1 -- how did it go????
0
 
rstorm1Author Commented:
I have not been able to test this yet, but don't want to leave the question hanging any longer.  Problem is, I don't have a spare Exchange box to test on before running in production and am going to have to put one together in all my spare time.  Too many fires to stomp!  Thanks for your help, I will try this when I can get another Exchange server set up.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.