Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Exchange / Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

September 15, 2023 ExchangeMicrosoft 365OutlookPowerShell

Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

In Exchange Server and Exchange Online (Microsoft 365), you can enable email forwarding at the mailbox level (configured by the administrator using the ForwardingAddress attribute), through mailbox Inbox rules, or directly from Outlook (users can do this themselves through the ForwardingSMTPAddress attribute).

Contents:
  • Enable/Disable Forwarding on a User Mailbox with Exchange Admin Center
  • Manage Email Forwarding for an Exchange Mailbox with PowerShell

Enable/Disable Forwarding on a User Mailbox with Exchange Admin Center

You can enable/disable email forwarding for a mailbox in the Exchange Admin Center:

You can enable and disable email forwarding for a user mailbox through the Exchange Admin Center:

  1. Sign in to the EAC web interface;
  2. Go to Recipients -> select a mailbox -> Edit;
  3. Click the Mailbox Features -> scroll down to Mail Flow -> View details;
  4. Check the Enable forwarding option and select a recipient user mailbox to which you would like all incoming emails to be forwarded;;
  5. You can also enable the option Deliver message to the both forwarding address and mailbox. enable forwarding address in Exchange

Manage Email Forwarding for an Exchange Mailbox with PowerShell

My preference is to use PowerShell to enable or disable email forwarding for Exchange mailboxes.

There are two attributes in Exchange that you can use to configure forwarding for a mailbox:

  • ForwardingAddress
  • ForwardingSmtpAddress

The ForwardingSmtpAddress attribute allows to enable email forwarding to any internal or external SMTP address. The Outlook/OWA GUI allows users to configure the target recipient address in this attribute. If an external SMTP address is specified here, such forwarding will only work for trusted external domains. Your Exchange administrator configures the list of trusted domains (Remote Domains) and whether you can automatically forward e-mail to them.

Get-RemoteDomain | fl DomainName,AutoForwardEnabled

Enable email forwarding in Outlook

Learn how to enable mail forwarding to external SMTP addresses in Microsoft 365/Exchange Online.

The ForwardingAddress attribute allows an administrator to configure email forwarding to any mail-enabled object in the Exchange organization. Users cannot directly change the value of this attribute.

Connect to your Exchange organization using PowerShell:

  • If you are using an on-premises Exchange Server, connect to it using the PowerShell commands:
    $UserCredential = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://mun-exch1.woshub.com/PowerShell/ -Authentication Kerberos -Credential $UserCredential
  • You can use the Exchange Online PowerShell module to connect to a Microsoft 365 tenant:
    Connect-ExchangeOnline -UserPrincipalName [email protected] -ShowProgress $true
You can use certificate-based authentication to connect Exchange Online/Microsoft 365.

To enable automatic e-mail forwarding to another mailbox in your organization, run the command below:

Set-Mailbox [email protected] -ForwardingAddress [email protected] -DeliverToMailboxAndForward $true

In this example, all emails sent to h.werner will be automatically forwarded to the maxadm mailbox. The DeliverToMailboxAndForward option indicates that an e-mail copy will be saved in the original recipient’s mailbox. If you set DeliverToMailboxAndForward $false, the emails will not be delivered to the recipient’s original mailbox.

You can check whether email forwarding is enabled for a specific mailbox:

Get-Mailbox -Identity [email protected] |fl ForwardingAddress, ForwardingSmtpAddress, DeliverToMailboxAndForward

Get-Mailbox forwardingadress in Exchange with PowerShell

To disable automatic forwarding:

Set-Mailbox -Identity [email protected] -DeliverToMailboxAndForward $False -ForwardingAddress $null -ForwardingSmtpAddress $null

To find all mailboxes with automatic forwarding enabled in an organization:

Get-Mailbox -ResultSize Unlimited -Filter "ForwardingAddress -like '*' -or ForwardingSmtpAddress -like '*'" | Select-Object Name,ForwardingAddress,ForwardingSmtpAddress

List Exchange mailboxes with a forward enabled

In addition to auto-forwarding, you can configure auto-reply rules (Out of Office) for an Exchange mailbox.

If both the ForwardingAddress and ForwardingSMTPAddress attributes are configured for a mailbox, the ForwardingSMTPAddress value is ignored as less prioritized.

If you want to set up a mail forwarding to an external SMTP address using the ForwardingAddress attribute, you must first create a contact for such an address:

New-MailContact -Name "ext. Heinz Werner" -ExternalEmailAddress "[email protected]"

Then set up an internal email address for the contact:

Set-MailContact "ext. Heinz Werner" -EmailAddresses "SMTP:ext_h.werner @woshub.com,[email protected] "

Then use the Set-Mailbox cmdlet to configure forwarding to the external contact.

In addition to mailbox-level forwarding, users and administrators can configure Exchange Inbox rules (can be configured from within Outlook) to forward email.

For example, an administrator can create a mailbox rule to automatically forward all e-mails with the specific subject to a different mailbox:

New-InboxRule -Name ForwardPowerAlertstoHelpdesk -Mailbox h.werner -SubjectContainsWords "DC Power Alert" -ForwardTo "Helpdesk"

You can list all the mail forwarding rules that have been configured at the Outlook level for all the user mailboxes in the organization:

$mailboxes=get-mailbox –resultSize unlimited
$rules = $mailboxes | foreach { get-inboxRule –mailbox $_.alias }
$rules | where { ( $_.forwardAsAttachmentTo –ne $NULL ) –or ( $_.forwardTo –ne $NULL ) –or ( $_.redirectTo –ne $NULL ) }  | ft name, MailboxOwnerId, ForwardTo, Description

You can configure mail forwarding rules not only for personal user mailboxes but also for shared Exchange mailboxes. You don’t need to grant yourself access to the mailbox when you create a mail forwarding rule from PowerShell.

0 comment
0
Facebook Twitter Google + Pinterest
previous post
How to View and Change BIOS (UEFI) Settings with PowerShell
next post
Installing Language Pack in Windows 10/11 with PowerShell

Related Reading

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

How to Create UEFI Bootable USB Drive to...

September 11, 2023

Managing Windows Firewall Rules with PowerShell

August 31, 2023

Disable Welcome Message for Microsoft 365 Groups

August 28, 2023

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023
  • How to Create UEFI Bootable USB Drive to Install Windows

    September 11, 2023
  • Redirect HTTP to HTTPS in IIS (Windows Server)

    September 7, 2023
  • Add an Additional Domain Controller to an Existing AD Domain

    September 6, 2023
  • How to Install an SSL Certificate on IIS (Windows Server)

    September 5, 2023
  • Managing Windows Firewall Rules with PowerShell

    August 31, 2023
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows

    August 30, 2023

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Outlook Keeps Asking for Password on Windows
  • How to Manually Configure Exchange or Microsoft 365 Account in Outlook 365/2019/2016
  • FAQ: Licensing Microsoft Exchange Server 2019/2016
  • Search and Delete Emails from User Mailboxes on Exchange Server (Microsoft 365) with PowerShell
  • Fix: Microsoft Outlook Search Not Working on Windows 10/11
  • Configure Auto-Reply (Out of Office) Message in Exchange and Microsoft 365
  • How to Delete or Rename Default Mailbox Database in Exchange Server
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top