Build your CSV containing the email addresses and domain names or export from your current lists. Here’s a quick shot of what your CSV file should look like. NOTE: that the import will allow for “*.domain.com”.

Example CSV of addresses

b1

Example CSV of domains

b2

Please note that you’ll see the spilt import for email addresses and domain names below. Your transport rule and your CSV files must align accordingly.

Bulk import of Whitelist

Run the below PowerShell to allow the sender Address :

foreach ($content in (get-content “C:\whitelist.csv”)){$temp=(get-transportrule “Whitelist sender address matches”).FromAddressContainsWords;$temp+=$content;set-transportrule “Whitelist sender address matches” -FromAddressContainsWords $temp}

Run the below PowerShell to allow the senders domain :

foreach ($content in (get-content “C:\whitelist.csv”)){$temp=(get-transportrule “Whitelist 2”).FromAddressContainsWords;$temp+=$content;set-transportrule “Whitelist 2” -FromAddressContainsWords $temp}

Bulk import of Blacklist

Run the below PowerShell to block the senders address :

foreach ($content in (get-content “D:\blacklist_addresses.csv”)){$temp=(get-transportrule “Blacklist”).From;$temp+=$content;set-transportrule “Blacklist” -From $temp}

Run the below PowerShell to block the senders domain :

foreach ($content in (get-content “D:\blacklist_domain.csv”)){$temp=(get-transportrule “Blacklist Domain”).SenderDomainIs;$temp+=$content;set-transportrule “Blacklist Domain” -SenderDomainIs $temp}