Disable/Enable spam/junk filtering for all Office 365 users

Use powershell to set the spam/junk filter operation for all users:

  1. $UserCredential = Get-Credential
  2. $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  3. Import-PSSession $Session
  4. Get-Mailbox
  5. Get-Mailbox | Set-MailboxJunkEmailConfiguration –Enabled $False

This disables the filter for all. Change $False to $True in #5 to enable the filter for all.