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.
(objectClass=*)(altrecipient=*)
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…!!!


Excellent
Comment by prabhu — June 7, 2008 @ 8:58 pm
[...] Please refer my previous post FAQ: Find all users with Forwarding Address is set [...]
Pingback by Find Exceptional Mailboxes in the Exchange Environment « Exchange Server Share — June 11, 2008 @ 4:02 pm
Hi,
Is there a script to set the selected users mail forwarding address back to none?
Thanks
Calvin
Comment by Calvin — June 11, 2008 @ 5:21 pm
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
}
======================================
Comment by Amit Tank — June 12, 2008 @ 4:09 am
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
Comment by Terrance Brennan — September 30, 2008 @ 4:06 pm
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.
Comment by Terrance Brennan — September 30, 2008 @ 4:12 pm