• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Tachytelic.net

  • Sco Openserver
    • Sco Unix Support
    • SCO Openserver Installation ISOs
    • SCO Openserver Binaries
    • Add a Hard Drive to an Openserver 5 Virtual Machine
    • Install SCO Vision SQL-Retriever ODBC Driver on Windows 10
    • License Expired on Virtual SCO Openserver Installation
    • How to reset the root password on SCO Openserver 5
  • Scripting
    • PowerShell
      • Add leading zeros
      • Check if a File Exists
      • Grep with Powershell
      • Create Environment Variables
      • Test for open Ports
      • Append to a Text File
    • VBScript
      • Check if a File Exists
      • lpad and rpad functions
      • Windows Update E-Mail Notification
  • Office 365
    • Connect to Office 365 with PowerShell
    • Add or remove an email alias using Powershell
    • Change Primary email address of Active Directory user
    • How to hide an AD user from the Global Address List
    • How to hide mail contacts from the Global Address List
    • Change the primary email address for an account with PowerShell
    • Change Primary email address of an AD User
    • Grant a single user access to access to all calendars
    • Forward email to an external address using Powershell
    • Convert shared mailbox to user mailbox with Powershell
  • Get in Touch
  • About Me
    • Privacy Policy

Office 365: Forward email to an external address with Powershell

March 19, 2014 by Paulie Leave a Comment

The Office 365 Admin Portal allows you to forward a users email to another mail contact easily. But it does not allow you to forward email for a user to an external address which has not been created in your tenant. However, you can do this with PowerShell, and here is how to do it using the Set-Mailbox cmdlet. For example:

Set-Mailbox -Identity [email protected] -DeliverToMailboxAndForward $true -ForwardingSMTPAddress [email protected]

The DeliverToMailboxAndForward Parameter

If set to $true then DeliverToMailboxAndForward parameter of the Set-Mailxbox cmdlet will deliver mail to both the forwarding address and the original recipient. However, if it is set to $false, it will deliver mail only to the forwarding address.

Use PowerShell to forward email to an external address

  1. Fill in the form below and the correct PowerShell code will be created for you.
  2. Then choose if you would like the mail delivered only to the forwarding address, or to the forwarding address and the original mailbox.

If you want to disable the forward in the future simply enter $null as the address that you would like to forward to and the forwarding will be cancelled.

Security Warning

After you make the changes above the administrators of your Office 365 Account may receive a warning message informing them this change has taken place:

Image showing Low Level Security Warning from Office 365 when a new Mail Redirection has been created.
Security Warning from Office 365

I hope this post was helpful to you, if you want to learn how to remove a forwarding, please check out this post.

Related

Filed Under: How To, Office 365, Scripts & Utilities Tagged With: E-Mail, Office 365, Powershell

Reader Interactions

Leave a Reply Cancel reply

Primary Sidebar

Link to my LinkedIn Profile
Go to mobile version