Office 365: Tenancy Restrictions and Email Forwarding Prevention

Tags: Office 365, Tennancy Restrictions, Email Forwarding

First, to get a list of all of the users who have forwarding addresses and shut them down, run this command:

Get-Mailbox -resultsize unlimited | Where {$_.ForwardingSMTPAddress -ne $null} | select PrimarySmtpAddress,DisplayName,ForwardingSmtpAddress,DeliverToMailboxAndForward | Export-Csv c:\forwarders.csv

Then, run these commands to clear the setting and stop forwarding for the individuals that appear on the report.

Set-Mailbox $user -ForwardingSMTPAddress $null
Set-Mailbox $user -DeliverToMailboxAndForward $false

I found this information here: http://social.technet.microsoft.com/Forums/exchange/en-US/3780e72f-98cf-48a9-8b61-ef4ba214a834/remove-forwarding-address-with-powershell

However, to apply this globally, I had to get help from MS tech support to modify the base options on our User Roles in Permissions on the ECP. There's an option called MyBaseOptions which allowed us to turn off forwarding for all users.

I run the above script every now and then just to see which users are trying to enable this feature because even though they try, the policy blocks it. And as a precaution, I leave it on for my account in case it ever breaks (which it did one time) and allows forwarding. So if I ever see work email on one of my personal accounts, I know there is trouble and call MS tech support right away.

Source: https://office365.uservoice.com/forums/273493-office-365-admin/suggestions/9254103-prevent-users-connecting-to-office-365-personal-ac

1 Comment

  • researchadmin said Reply

    https://docs.microsoft.com/en-au/azure/active-directory/manage-apps/tenant-restrictions

You must log on to comment.