Exchange Server: Whitelisting domains and email addresses

I figured that there is a lot of wrong tutorials out there on how to whitelist domains or individual emails on Exchange 07/10/13.

I spoke to a friend the other day, and he had a seriuos problem, he said: “I’m entering some emails and domains into Exchange Whitelists, but they keep on disappearing”

Commands that he was using were:

Set-ContentFilterConfig -BypassedSenders username@domain.cpn

or

Set-ContentFilterConfig -BypassedSenderDomains domain.cpn

Commands were working, but THESE COMMANDS ARE WRONG! Each time you use the Set-ContentFilterConfig command, you are overwriting the content filter configuration with a new configuration file!

That’s why my friend was losing his previous entries and seeing only the last one he entered.

In order to keep your previous entries and be able to enter new ones on top of the old, you need to enter following commands into PowerShell:

For domains:

$list = (Get-ContentFilterConfig).BypassedSenderDomains
$list.add(“domain.com”)
Set-ContentFilterConfig -BypassedSenderDomains $list

 

Real life example of domain entries:
$list = (Get-ContentFilterConfig).BypassedSenderDomains
$list.add(“informaticar.net”)
$list.add(“medicblog.net”)
And then, confirm and save your entries with
Set-ContentFilterConfig -BypassedSenderDomains $list

If you want to check entries that you entered, you can check them with:
Get-ContentFilterConfig
You’ll see your entries under BypassedSenderDomains row.
I won’t put up my screenshots, since I have a long list with production emails.

 

For individual e-mail addresses:

$list = (Get-ContentFilterConfig).BypassedSenders
$list.add(“address@domain.com”)
Set-ContentFilterConfig -BypassedSenders $list

 

Real life example of e-mail address entries:
$list = (Get-ContentFilterConfig).BypassedSenders
$list.add(“testmail@informaticzer.net”)
$list.add(“testmail@medazcblog.net”)

And then, confirm and save your entries with
Set-ContentFilterConfig -BypassedSenders $list

If you want to check entries that you entered, you can check them with:
Get-ContentFilterConfig
You’ll see your entries under BypassedSenders row.

 

If you want to remove some of whitelisted domains or email users you’ll use some of these commands

Set-ContentFilterConfig -BypassedSenderDomains @{Remove=”domain.com”}
Set-ContentFilterConfig -BypassedSenders @{Remove=”mail.domain.com”}

 

Disclaimer