Skip to main content

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 from this blog

Error - QuarantinedAttributeValueMustBeUnique

Case History. 1. Client already had users created in office 365 2. Client wanted to setup SSO for office 365 users Approach for requirement fullfilment   1. Deployed and configured Azure AD connect      95% users were synced and soft match was successfully done  5% users were getting error - QuarantinedAttributeValueMustBeUnique  (to view the sync issues -  https://aad.portal.azure.com/#blade/Microsoft_Azure_ADHybridHealth/AadHealthMenuBlade/SyncErros )  When we checked 2 users were found under Active users  1. one in Cloud (this was created earlier/ already existed ) with active licenses and Mailbox 2. one unlicensed synced with AD Solution - 1. Delete the unwanted user in Azure or AD as per this document.  https://blogs.msdn.microsoft.com/hkong/2017/03/23/how-to-fix-attributevaluemustbeunique-error-message-when-trying-to-sync-an-object-from-on-premises-active-directory-to-office-365/ ...

Error - AttributeValueMustBeUnique in Azure AD connect sync

My customer had already created accounts in office 365 and managing them in Azure, however due to some changes in business they wanted to sync AD with Azure to sync Password and Manage Identity form AD. Solution - Deploy Azure AD connect on ADDC, and post that it will do a Soft Match. However there were error with some users, their identities did not sync and their status still reflected as Azure AD. Error -  Unable to update this object because the following attributes associated with this object have values that may already be associated with another object in your local directory services: [ProxyAddresses SMTP:user@domain.com;].  Correct or remove the duplicate values in your local directory.  Please refer to http://support.microsoft.com/kb/2647098 for more information on identifying objects with duplicate attribute values. Tracking Id: b8367c95-ae67-46e1-xxxx-xxxxxxxxxx ExtraErrorDetails: [{"Key":"ObjectId","Value":["cd088468-bb6a-4...

Microsoft office 365 product shows as not activated after few days.

Solution Opened CMD Navigated to Path - cd C:\Program Files (x86)\Microsoft Office\Office16\14\15 To view the installed product key, execute cscript ospp.vbs /dstatus To uninstall an installed product key, execute cscript ospp.vbs /unpkey:XXXXX Replace the XXXXX with the last five character of the currently installed product key (found in step 3). Last 5 digits only To activate Office with the new product key, execute cscript ospp.vbs /act