Add domains on Whitelist via Powershell

Spam protection in Microsoft Exchange Server 2013, as in previous versions, offers the opportunity to whitelist email addresses and domains from trusted senders, emails from which, regardless of content, should always be received.

Messages from whitelisted senders (individuals or entire domains) are considered safe and end users receive them, even if they are within the filter rules. The senders whitelist in Microsoft Exchange Server 2013 can only be managed at the Powershell command prompt (Exchange Management Shell).

Note . The whitelist of senders in Exchange 2007 and 2010 is configured in the same way.

The whitelist in Exchange 2013 is configured on the Mailbox or Edge Transport server with Exchange anti-spam protection installed.

Read more:

The importance of email auditing
Enable Office 365 message encryption
Understand the new modality of Add-ons for Office 365 licenses
365 free ebooks on productivity
How to make out of office messages easier for users in Office 365

The spam filter based on content filtering checks whether the address is whitelisted. To edit the white list of addresses, the cmdlet ContentFilterConfig it is used. The command has the following syntax:

Set-ContentFilterConfig -BypassedSenderDomains

After executing this command, all messages from senders in the domain will be received by Exchange users, regardless of their content or attachments. (Additional verification with the Content Filter will not take place.)

Antispam Exchange 2013

You can view the current contents of the domain whitelist using this command:

Antispam Microsoft Exchange Server 2013

#Profissa: Take a professional course!
Ensure a certified course in IT and Software through the online study platform Udemy.
click here and check out all the latest technology courses!

If you need to add multiple domains to the white list at once, the command will look like this:

Set-ContentFilterConfig -BypassedSenderDomains,,

To add a specific email address to the Content Filter white list, use the BypassedSenders parameter:

Set-ContentFilterConfig -BypassedSenders [email protected]

The main problem with using the Set-ContentFilterConfig cmdlet is that, whenever it runs, it completely rewrites (clears) the current white list of safe senders. To avoid this, whenever you need to add a new address / domain to this list, obtain the current white list of addresses, add a new one and upload it again to Exchange.

#Profissa: Take a professional course!
Ensure a certified course in IT and Software through the online study platform Udemy.
click here and check out all the latest technology courses!

To add multiple domains to the Exchange white list (without clearing the entries in the current list), you can use the following script:

$ list = (Get-ContentFilterConfig) .BypassedSenderDomains $ list.add ("") $ list.add ("") $ list.add ("") Set-ContentFilterConfig -BypassedSenderDomains $ list

If you are adding individual addresses:

$ list = (Get-ContentFilterConfig) .BypassedSenders $ list.add ("[email protected]") $ list.add ("[email protected]") Set-ContentFilterConfig -BypassedSenders $ list

To delete an entry from the white list of senders, run this command:

Set-ContentFilterConfig -BypassedSenderDomains @ {Remove = ""}


Set-ContentFilterConfig -BypassedSenders @ {Remove = "[email protected]"}

Was this article helpful?

To maintain a quality standard for you, we have invested in a great hosting plan, Paid CDN, Website Optimization Plugins, etc ...

Help us to keep the project active! 

Follow the news in real time. Follow our Instagram profile..

Felipe Santos
Felipe Santos is a Cloud and Security Architect, with experience in Windows Server, Cluster, Storages, Backups Veeam and Office 365 environments.



Do you want to upgrade your career? 

Invest in yourself and get ahead! Get that dream job in 2022!