Block and Allow in Office 365 Small Business

Dude, where’s my rules?

I’ve already written a post on how to blacklist a domain in Office 365, but if you’re on the Small Business or Small Business Premium plans, that feature is not available (Source):



Now What?

Thankfully, there are still a few options available for managing your junk mail flow – here are three:

Option 1: Add the email address that’s getting stuck in your junk mail to your contacts – by default, Office 365 marks all email from your contacts as safe:


Option2: Add the email address under Block or allow:

To get to Block or allow, click on the cog beside your name (top right), and then select options:


Select block or allow from the menu on the left, and then start adding addresses that are getting caught by the spam filters, and click the + button each time. Note that you can also allow entire domains here as well, so that might be quicker than adding one user at a time.



The same rule in reverse applies to people you want to live permanently in your junk mail folder – add them to the blocked senders list, and click the + button. Again, you can block entire domains here, so keep those spammers out of your life!


Once you’ve added the addresses you want to block or allow, click Save at the bottom of the screen to save your changes.

Of course, you can achieve the same ends by right clicking on an email message in your Outlook inbox and selecting Block Sender,

or by selecting an email in your junk mail folder and clicking Mark as not junk.


Mind you, this only manages email for a single user, and you either need to do these steps from the users Outlook or webmail. If you want to block or allow a domain for your entire organization, you’ll need to use option 3.


Option 3: PowerShell

Where would we be without PowerShell? If you want to be able to update a single user (or your entire organization), then PowerShell is the way to go. PowerShell also allows you to update the blocked and allowed domains without needing to log in to the user’s account – much neater.

First, let’s see what’s being blocked or allowed for our user:

Get-MailboxJunkEmailConfiguration -Identity

Here we see some trusted senders and domains, but nothing blocked:


Now, let’s add some blocked senders and domains:

Set-MailboxJunkEmailConfiguration -Identity -BlockedSendersAndDomains “”,””

If you run a Get-MailboxJunkEmailConfiguration, you can see that the blocked domains have been added:


What about if you want to add some safe senders, or both at the same time? All you need to do is run the following command:

Set-MailboxJunkEmailConfiguration -Identity -BlockedSendersAndDomains “”,”” -TrustedSendersAndDomains “”

Now you can see that it’s updated your list of blocked or allowed domains, but here’s a gotcha: This command overwrites the Trusted and Blocked List EVERY SINGLE TIME!


That’s the reason why I haven’t given you the command that updates your entire organization at once – but of course, you would have tried it on a test user before releasing this script into the wild, right? šŸ˜‰

Ok, here’s the way you update your blocked and allowed list for your entire organization:

Get-Mailbox | Set-MailboxJunkEmailConfiguration -BlockedSendersAndDomains “”,”” -TrustedSendersAndDomains “”, “

You can add as many email addresses or domains as you need to, just keep adding the domains in quotes separated by a comma. Also, it would be a good idea to keep a list of the domains that you’ve blocked and allowed in your organization, just in case you accidentally overwrite it – better safe than sorry!

Now, it is possible to update the list without overwriting it each time, but that process is very nicely broken down (along with all these steps) in the following KB article.

Good luck, and don’t forget:

“With great power comes great responsibility” – Uncle Ben

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.