Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, March 30, 2011 6:31 AM | 2 votes
Hi guys,
I simple question I guess, but the shell is not my greatest strength...
I have set a forwarding adress with Set-Mailbox -ForwardingSmtpAddress [email protected] -DeliverToMailboxAndForward $true, now Iwant to remove the forwarding rule, but how can I specify a blank fowrwrding smtp address? the parameter requires a valid address and I did not found an argument to remove the forwardin adress. I need to do this from Exchange Shell
Thank you
Marius
All replies (9)
Wednesday, March 30, 2011 12:22 PM ✅Answered | 3 votes
Set the address to $null should work.
Simon.
Simon Butler, Exchange MVP
Blog | Exchange Resources | In the UK? Hire Me.
Friday, April 1, 2011 6:40 AM
Hi,
Sembee is right.
Run this command:
Set-Mailbox –Identity “ [email protected]” -ForwardingAddress $null
You can check it via EMC.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Monday, April 4, 2011 6:51 PM
Hi,
How did you get the ForwardingSmtpAddress to work? I've set it and it doesn't seem to do much.
Monday, April 4, 2011 8:09 PM
Hi
it worked in my case
because I have a hosting install, i run the following command:
Get-Mailbox -Organization organization_name -Identity [email protected] |Set-Mailbox -ForwardingsmtpAddress $null
Marius
Monday, June 27, 2011 7:25 PM
Has anyone had any luck doing this programmatically? I've tried the following (and 3 other Parameter.Add variations) without success.
Cannot process argument transformation on parameter 'ForwardingSmtpAddress'. Cannot convert value "" to type "Microsoft.Exchange.Data.ProxyAddress". Error: "The e-mail address cannot be empty."
Pipeline pipeLine = PsRunspace.CreatePipeline();
Command command = new Command("Set-Mailbox");
command.Parameters.Add("Identity","[email protected]");
command.Parameters.Add("ForwardingSMTPAddress");
pipeLine.Commands.Add(command);
pipeLine.Invoke();
// I've also tried the following without luck
command.Parameters.Add("ForwardingSMTPAddress",null);
command.Parameters.Add("ForwardingSMTPAddress",string.Empty);
command.Parameters.Add("ForwardingSMTPAddress","$null");
Tuesday, January 31, 2012 9:03 PM
Hi,
I came across your post and trying to set forwarding SMTP address NULL programmatically. When it is null I get the error "Error: "The e-mail address cannot be empty."" But when I put NULL it does not give any error but it does not set the forwardingSMTPAddress null either. I will greatly appreciate if you can share your findings.
Thank You.
RJ
Tuesday, January 31, 2012 9:14 PM
In my case worked Get-Mailbox -Organization OrgName -Identity [email protected] |Set-Mailbox -ForwardingAddress $null
I have a /hosting install. But i never tried it programatically.
Marius
Wednesday, July 11, 2012 2:39 PM
It's working indeed when you use Powershell v2.
But running the same command using Powershell v3 (well it's not RTM yet as far as I know) it seems impossible to set the forwardingaddress to $null.
Any idea? Will this be fixed with Powershell v3 RTM
Thanks
Wednesday, January 27, 2016 10:59 AM
Exactly what I needed, good example Thanks