Remove forwarding address with PowerShell
Adding a forwarding address with PowerShell is simple and straightforward, but how can I remove a forwarding address? Can I remove a forwarding address using PowerShell? We have to remove the forwarding address from several hundred mailboxes during a migration and would much rather not do it one at a time in the console.
Thanks
September 30th, 2008 6:59pm
Hi TPBrennan,
This will remove all forwarders...
Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Set-Mailbox -ForwardingAddress $null -DeliverToMailboxAndForward $false
If you have list of users in text file then check the comment in my article below...
FAQ: Find all users with Forwarding Address isset
http://exchangeshare.wordpress.com/2008/05/26/faq-find-all-users-with-forwarding-address-is-set/
Free Windows Admin Tool Kit Click here and download it now
September 30th, 2008 7:07pm
Thanks for your time and response.
September 30th, 2008 7:22pm
Hi-I am new to powershell...and looking to set the forwarding for like a hundreds of users... I noticed this forum..that there is an easy cmdlet for it? If so can anyone help? Thanks.
December 17th, 2008 1:47am
Amit,
This command is exactly what we are looking for to remove the email forwarders that we currently have in place. Is there a way to just apply it to a group of users under a OU and not all accounts?
Thanks,
-Phil
Free Windows Admin Tool Kit Click here and download it now
June 16th, 2010 5:01pm
Amit,
This command is exactly what we are looking for to remove the email forwarders that we currently have in place. Is there a way to just apply it to a group of users under a OU and not all accounts?
Thanks,
-Phil
Yes, u will have to mention correct OU for get-mailbox command like this
Get-Mailbox -organizationalUnit
"Yourdomain.com\yourOU" -ResultSize Unlimited | Where {$_.ForwardingAddress -ne $null} | Set-Mailbox -ForwardingAddress $null -DeliverToMailboxAndForward $false
Regards,
Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM)
www.HostingController.com
June 16th, 2010 5:18pm
Great, I was looking for this as well.
Cheers!
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2011 11:17pm
Hi Amit
i have list of users in text file and need to remove forwader from all the email address.
March 6th, 2012 3:12am
HI
If the text file format is .CSV
like
======================================
Name,Alias,emailaddress
joseph pradeep,joseph,joseph.pradeep@domain.com
arun kumar,arunk,arunk@domain.com
===================================
$users = import-csv c:\userlist.csv
$users | % { get-mailbox $_.alias | Where {$_.ForwardingAddress -ne $null} | Set-Mailbox -ForwardingAddress $null -DeliverToMailboxAndForward $false }
Thanks Joseph Pradeep =========================================================== If you found this post helpful, please give it a "Helpful" vote. If it answered your question, remember to mark it as an "Answer".
Free Windows Admin Tool Kit Click here and download it now
March 6th, 2012 10:43am