• Admin

Block specific email address or domain in O365

Connect to O365 either via Azure Powershell or Windows Powershell

Run the following commands in one go, just feed the Global Administrator details when prompted.

Import-Module MSOnline

$O365Cred = Get-Credential

$O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $O365Cred -Authentication Basic -AllowRedirection

Import-PSSession $O365Session -AllowClobber

Connect-MsolService -Credential $O365Cred

Once connected, run the following command to block the Email Address or Email Domain

Get-Mailbox -ResultSize Unlimited | Set-MailboxJunkEmailConfiguration -BlockedSendersAndDomains "","","",""

Check the addition in bulk : 

Get-Mailbox -ResultSize Unlimited | Set-MailboxJunkEmailConfiguration

Result will look like :

8 views0 comments
  • LinkedIn
  • Facebook Clean
  • Twitter Clean
  • White Google+ Icon


© 2020 by aarbin technology pvt ltd