Maximize your protection, eliminate business risks.
Optimize and modernize with cloud transformation.
Empower your people to work securely from anywhere.
Let us handle IT so you can focus on growing your business.
Get multichannel 24/7/365 expert end-user support.
Protect, detect, and respond—Dataprise keeps your business secure.
Maximize uptime with with industry-leading DRaaS.
Swiftly mitigate cyber threats and restore security.
Improve efficiency, productivity and outcomes with cloud.
Ensure all mobile devices, everywhere, are secure.
Gain a competitive edge with strategic IT solutions.
This battle-tested checklist enables your team to swiftly initiate a ransomware response.
IT for businesses of all sizes, in any industry.
Empower institution growth with custom IT solutions.
Ensure your firm is always in compliance.
Improve patient care and staff morale.
Deal with pressing legal matters, not IT.
Keep up with the evolving digital landscape.
Focus on your mission by outsourcing IT.
Accelerate PE client deals and secure data.
Empower Your Municipality with Secure, Reliable IT Services
Execute initiatives and develop IT strategies.
Get the latest industry insights and trends.
Join us at events in person and online.
Hear from clients and learn more about strategic IT.
See how Dataprise can make IT your greatest asset.
Get informative technical resources from IT experts.
Stay on stop of emerging cybersecurity threats.
Discover the key areas of DR your organization needs to address to ensure downtime is minimized.
Gain a strategic asset by bringing harmony to IT.
Ensure 24/7 support and security with dedicated teams.
Drive business forward by partnering with Dataprise.
Meet our one-of-a-kind leadership team.
Discover the recognition Dataprise has earned.
Help us help businesses with strategic IT.
Grow through acquisition and partnership with Dataprise.
Embracing different perspectives and backgrounds.
Find a Dataprise location near you.
Dataprise is committed to empowering more women to consider a career in technology.
Explore our trusted partnerships with leading tech innovators.
Posts
By: Dataprise
Table of content
We had a client that had the need for a mass import of whitelists and blacklists. A quick Google rendered a few results however each command failed for various reasons. We were in a time crunch so a call to Microsoft was in order. They provided us with a “newer” set of commands.
You’ll first need to create your domain or user-based safe sender or blocked sender list. See TechNet article below for those steps. https://docs.microsoft.com/en-gb/office365/SecurityCompliance/create-organization-wide-safe-sender-or-blocked-sender-lists-in-office-365?redirectedfrom=MSDN
Next 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
Example CSV of domains
Connect to O365 via PowerShell
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}
Brandon Stuart, PEI
INSIGHTS
Subscribe to our blog to learn about the latest IT trends and technology best practices.