Solved

Add secondary SMTP Address with Powershell

Posted on 2010-09-23
2
6,195 Views
1 Endorsement
Last Modified: 2012-06-21
 I have Exchange 2007 with 1000 mailboxes defined. Each mail box has a Primary SMTP address added by an Address Police. I have about 200 Mailboxes that I need to add a secondary SMTP address. I would like to do this with powershell. When I try to add them with the Set-Mailbox command I get the following error.

Set-Mailbox : The e-mail addresses for this recipient are automatically generat
ed based on e-mail address policies. To modify the primary SMTP address for thi
s recipient, you must disable automatic updating of e-mail addresses based on e
-mail address policy.

  Ok So I disable the address policy with;
Set-Mailbox  -EmailAddressPolicyEnabled $False
And rerun the Set-Mailbox -emailaddresses user1@test.com and I get the following error;
Set-Mailbox : There is no primary SMTP address.

  All I want to do is add another Secondary SMTP address with PowerShell, without disturbing the address that are already there.  I can do this all day long with the Exchange Management Console!
1
Comment
Question by:gogetsome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

Accepted Solution

by:
endital1097 earned 500 total points
ID: 33746171
$user = get-malbox <user>
$user.emailaddresses += "smtp:second@domain.com"
set-mailbox $user -emailaddresses $user.emailaddresses
0
 

Author Closing Comment

by:gogetsome
ID: 33746740
Thanks,
That works great! That is what I thought that you were going to tell me. The list must be rebuilt each time.  I would have never come up with code that clean to rebuild the list on my own. I still do not have a good handle on storing an entire object in a variable. I guess I am still to old school!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Find out what you should include to make the best professional email signature for your organization.
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question