Disable Spam and Junk Filtering for All Users in Office 365 Using PowerShell with MFA Enabled

Disable Spam and Junk Filtering for All Users in Office 365 Using PowerShell with MFA Enabled

 

To easily and properly turn of  junk and spam filtering in Office 365 you have to use PowerShell, and it takes a specific set of tools and commands that is rather hard to find with all the different variations of Office 365 setups, so here is how to disable spam filtering in O365 using PowerShell when you have multi-factor authentication turned on (skip to section 2 if you do not have MFA turned on).

 

1) Connect to Exchange Online with MFA Turned On

 

Make sure that you are using the latest and most up to date version of the Microsoft Exchange Online PowerShell, you can do that by running the command from standard Powershell ( you may have to uninstall previous instances of Exchange PowerShell)

Install-Module Name- MSOnline -scope currentuser

Once you have the latest version of Exchange Online Powershell open it up and run the command:

connect-msolservice

You should now get your MFA enabled pop-up page

 

2) Disable Spam Filtering for all users with PowerShell

 

Connect-EXOPSSession –UserPrincipalName [email protected]

Get-Mailbox | Set-MailboxJunkEmailConfiguration –Enabled $False

or

$All = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited; $All | foreach {Set-MailboxJunkEmailConfiguration $_.Name -Enabled $false}

 

 

 

No Comments

Post A Comment