Search
  • 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 https://ps.outlook.com/powershell -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 "unitedwaypoco.org","redirectuniteplugs781@unitedwaypoco.org","noreply@officeservice.com","officeservice.com"


Check the addition in bulk : 


Get-Mailbox -ResultSize Unlimited | Set-MailboxJunkEmailConfiguration

Result will look like :



2 views
  • LinkedIn
  • Facebook Clean
  • Twitter Clean
  • White Google+ Icon

 

© 2020 by aarbin technology pvt ltd

+1-214-347-7988