Exchange Server Share

… Information sharing on Exchange Server …

FAQ: Find all users with Forwarding Address is set

This is most commonly asked question, how to get list of user with forwarding address is set.

Exchange 2003:

In native Exchange 2003 you can do a custom search in Active Directory Users & Computers to find all users with forwarding address is set with some internal or external address.


Example: I have set a forwarding address for User 32 to forward all mails to User 31.


Now find it with Custom Search.

Active Directory Users & Computers -> Find -> Select Custom Search -> Enter (objectClass=*)(altrecipient=*) in LDAP Query Text Box -> Click Find Now.


Exchange 2007:

If Exchange 2007 is in native mode or co-existence with Exchange 2003 then you can use PowerShell to find the same thing.

Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, ForwardingAddress, DeliverToMailboxAndForward

Example: I have set a forwarding address for User 22 to forward all mails to User 21.


Now find it with PowerShell.


Note: PowerShell gives all users who are on Exchange 2007 as well as Exchange 2003. You can see the Exchange Version in below screen.


Hope this helps you guys!!! Put your comments…!!!


Written by Amit Tank

May 26, 2008 at 11:50 am

6 Responses

Subscribe to comments with RSS.

  1. Excellent


    June 7, 2008 at 8:58 pm

  2. […] Please refer my previous post FAQ: Find all users with Forwarding Address is set […]

  3. Hi,

    Is there a script to set the selected users mail forwarding address back to none?




    June 11, 2008 at 5:21 pm

  4. Hi Calvin,

    Make sure that you run this on Exchange 2007 users only, if you add Exchange 2003 users to manage with Powershell (EMS) then you need to manage it with Powershell(EMS)/EMC everytime.

    Copy all users to users.txt file for whom you need to set forwarding address none -> Copy below code to RemFor.ps1 file -> Open EMS -> go to the path where these users.txt & RemFor.ps1 is available -> run this command ./RemFor.ps1

    $Users = get-content “users.txt”

    foreach ($user in $users)
    Set-Mailbox $user -ForwardingAddress $null
    Set-Mailbox $user -DeliverToMailboxAndForward $false
    Get-Mailbox $user | Select Name, ForwardingAddress, DeliverToMailboxAndForward

    Amit Tank

    June 12, 2008 at 4:09 am

  5. I believe in giving credit where it is due. This command works so I wanted to help the questioner on the MS forum, but I wasn’t about to take credit for your work. Thanks for the postings for those of us who need help

    Terrance Brennan

    September 30, 2008 at 4:06 pm

  6. I just read your last comment on how to remove the forwardingaddress from a user. Thanks, I have been looking for this all morning. You have no idea how much work you just saved me and my co-workers.

    Terrance Brennan

    September 30, 2008 at 4:12 pm

Comments are closed.

%d bloggers like this: