Forward emails from shared mailbox to external network or within Org


You can forward the emails which are received on shared mailbox to external users through PowerShell.

Please run the below mentioned commands. Open Windows PowerShell as an administrator (use Run as administrator).


Set-ExecutionPolicy RemoteSigned

$credential = Get-Credential

 Import-Module MsOnline

$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" –AllowRedirection

Import-PSSession $exchangeSession –DisableNameChecking

There are two options to set forwarding.

1. First sets the mailbox to forward but doesn’t keep a copy so when you look in the mailbox it will always be empty

Set-Mailbox user@.yourdomain.com –ForwardingSmtpAddress user@domain.com –DeliverToMailboxAndForward $false



2. Second which does keep a copy of the mail and forwards the mail.

 Set-Mailbox user@.yourdomain.com –ForwardingSmtpAddress user@domain.com –DeliverToMailboxAndForward $false



In the above command “user@yourdomain.com”  represents the shared mailbox and user@domain.com represents the external user.

Comments

  1. seond should have delivertomailboxandforward $true not false

    ReplyDelete
  2. We also create informative articles. Visit https://www.cloudbik.com for more information.

    ReplyDelete

Post a Comment

Popular Posts