Solved

Add secondary SMTP Address with Powershell

Posted on 2010-09-23
2
6,398 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
In this video we show how to create a Contact 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 >> Contact ta…
To show how to create a transport rule 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 Mail Flow >> Rules tab.:  To cr…

734 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