Bulk White-listing in EOP using PowerShell
Hello Team,
Did anybody missed me and my blog's. I will take it as yes :), Yes I am back with my 4th blog. This time it is about
"Bulk White-listing in Transport Rule."
We have scenario where we have more 100 of Domain or IP or Email address which we wanted to white-list. How to achieve the same. Please find the powershell command which we can use to achieve it.
How to whitelist multiple Domains.
- Create a csv file were you add all your domain name in a column. Attached is the snapshots for the same.
domain |
santosh.com |
hotmail.com |
facebook.com |
google.com |
Run the below commands
$csv = import-csv "C:\Users\santoshp\Desktop\domainlist.csv"
new-transportrule "domainlist" -senderdomainIs $csv.domain -setscl -1
- "domainlist" is the name of Transport Rule.
How to white-list multiple IP address.
- Create a csv file were you add all your domain name in a column. Attached is the snapshots for the same.
IP |
202.81.131.21 |
202.81.131.22 |
202.81.131.25 |
202.81.131.26 |
Run the below commands
$csv = import-csv "C:\Users\santoshp\Desktop\IP.csv"
New-TransportRule "IP address" -SenderIpRanges $csv.IP -SetSCL -1
How to whitelist multiple email address.
- Create a csv file were you add all your domain name in a column. Attached is the snapshots for the same.
s@ab.com |
b@xyz.com |
c@delta.com |
d@captainamerica.com |
Run the below commands
$csv = import-csv "C:\Users\santoshp\Desktop\email.csv"
New-TransportRule "Senders" -AnyOfRecipientAddressContainsWords $csv.Email -SetSCL -1
I hope above steps will help many admin's to add bulk Domain, IP address & recipient to Transport rule.
Regards,
Santp.
Comments
- Anonymous
January 01, 2003
This doesn't seem to work for me, i just get a blank new rule that applies to all messages.... - Anonymous
January 01, 2003
thank you - Anonymous
January 01, 2003
Robert, Try using the same column name which i used and that should work for you. - Anonymous
February 09, 2015
This doesn't work with email addresses. - Anonymous
March 11, 2015
Nice blog Santosh .. :)