1. Run O365 Powershell module: if you do not have it you can download the Azure Powershell client here: technet.microsoft.com/.../jj151815.aspx
2. Run commands below to get connected to 0365
$Cred = Get-Credential (enter your user name and password when prompted)
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri ps.outlook.com/powershell -Credential $Cred -Authentication Basic –
AllowRedirection
Import-PSSession $Session
3. Connect-MsolService
4. Now run the command to stop forwarding:
To remove forwarding change $true to $false and replace forwardingSMTPAddress with $null
Example:Set-Mailbox -Identity username@domain.com -DeliverToMailboxAndForward $false -ForwardingSMTPAddress $null