Get all users who have a forwarding address set

If you ever need to find all the users in your Exchange Organisation whom have a forwarding address configured, but also know what that address is – all you need to do is use this simple Powershell one-liner:

Get-mailbox | select DisplayName,ForwardingAddress | where {$_.ForwardingAddress -ne $Null}

About The Author

7 thoughts on “Get all users who have a forwarding address set”

    1. Try below command:

      Get-mailbox -ResultSize unlimited | select DisplayName,ForwardingAddress | where {$_.ForwardingAddress -ne $Null}

  1. Not working for me at SBS2011 + MSEXCH 2010:

    Windows PowerShell
    Copyright (C) 2009 Microsoft Corporation. All rights reserved.

    PS C:\Windows\system32> Get-mailbox | select DisplayName,ForwardingAddress | where {$_.ForwardingAddress -ne $Null}
    The term ‘Get-mailbox’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:12
    + Get-mailbox <<<< | select DisplayName,ForwardingAddress | where {$_.ForwardingAddress -ne $Null}
    + CategoryInfo : ObjectNotFound: (Get-mailbox:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

  2. This is great! How could I replace the “-ne $null” with something to specify a forward in place to a user? I tried changing “-ne $null” to “-eq “[email protected]”” but that didn’t work. We have some users forwarding to a specific user and would like to know everyone forwarding to that user. TIA

  3. A couple suggestions to improve on this: sometimes forwarding can be configured using the ForwardingSmtpAddress attribute (this may be Exchange Online specific but I’ve definitely seen it in our deployment), so checking for a non-null value there is useful. It’s also much more efficient to specify the filter using the -Filter parameter on Get-Mailbox instead of getting all mailboxes and then using Where.

    Get-Mailbox -Filter {ForwardingAddress -ne $null -or ForwardingSmtpAddress -ne $null} | Select DisplayName,ForwardingAddress,ForwardingSmtpAddress

  4. Thanks James (and Andy), that is just what I needed. I refined James’ one-liner with the following code:

    $FwdingMBs = Get-Mailbox -Filter {ForwardingAddress -ne $null -or ForwardingSmtpAddress -ne $null}
    Write-Host “Mailbox,FowardingSMTPAddress,ForwardingAddress”

    foreach ($mb in $FwdingMBs) {
    [string]$Output = $mb.DisplayName
    if ($mb.ForwardingSmtpAddress -ne $null) {
    $Output = “$Output,$($mb.ForwardingSmtpAddress)”
    } else {
    $Output = “$Output,”
    if ($mb.ForwardingAddress -ne $null) {
    [string]$fwdAddress = (Get-ADObject -Identity $(($mb.ForwardingAddress).DistinguishedName) -Properties mail).mail
    $Output = “$Output,$fwdAddress”
    } else {
    $Output = “$Output,”
    Write-Host $Output

    “`r`nScript Completed.”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top