Powershell command to set primary STMP for a user
We are in the process of adding some new email addresses with a different domain. On every user account we unchecked the box for the default recepient policy so we must add the address manually through a powershell. We want to address the new address first, then at some point in the future switch the primary SMTP address. Can this be done through a powershell command
July 9th, 2009 7:48pm

Yes, we can. First, please check recipient policy box back for all users with whatever method you used before. We can uncheck it again after complete the procedure below Please follow the To use the Exchange Management Shell to configure Exchange 2007 to accept e-mail for more than one authoritative domain section in this article, the step 1 - 3 would suit for your situation
Free Windows Admin Tool Kit Click here and download it now
July 9th, 2009 10:56pm

Hi, There are various methods to add email address to a set of mailbox. 1. You can create a csv file and then can import this csv file and can add email address from there like: The csv file will have 2 columns i.e. Identity (Unique identity of the users e.g Alias),and EmailAddress (email address to be added) Identity, EmailID user1 , user1@someOtherDomain.com user2 , user2@someOtherDomain.com user3 , user3@someOtherDomain.com Save this into some location like C:\AddEmailAddress.csv Then you can add email addresses to all users mentioned in the csv file like Import-CSV "C:\AddEmailAddress.csv" |foreach { $EmailIDs = (get-Mailbox $_.Identity).EmailAddresses $EmailIDs+= $_.EmailID Set-Mailbox $_.Identity -EmailAddresses $EmailIDs } Save this block of script into a file with .ps1 extension. To execute this .ps1 file just put this file into Bin or Script directory of Exchange Installation Folder and write the name of file in Exchange Management Shell and press enter. To remove an email address using above scrip just replac '+=' with '-=' . Also using same file, you can see the Email Addresses of the users using this script: Import-CSV "C:\AddEmailAddress.csv" |foreach { get-mailbox $_.Identity | FL EmailAddresses ,Prim*} Regards, Laeeq Qazi|Snr Software Engineer(Exchange + Sharepoint + BES + DynamicsCRM) www.hostingcontroller.com
July 10th, 2009 4:19am

Any update on this case?
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2009 4:14am

We have no tested this yet. Thanks for the information. I will keep everyone informed of when we tried this.
July 16th, 2009 7:35am

That worked great in our test environment.How does one set a particular email address as a primary using powershell?
Free Windows Admin Tool Kit Click here and download it now
July 21st, 2009 1:36pm

I found what I was looking for. Thanks again for all the help with this issue. This forum has a lot of of great people.
July 21st, 2009 7:13pm

J Glad to help
Free Windows Admin Tool Kit Click here and download it now
July 21st, 2009 8:53pm

Thanks a whole lot !!! this forum helped me to solve my problem !Chatou7
February 7th, 2011 12:42pm

Change the primary SMTP address of an existing user Run the following command: Set-Mailbox <Identity> -EmailAddresses SMTP:<new primary e-mail address>,<user ID>,<existing proxy address 1>,<existing proxy address 2>...For example, suppose your cloud-based organization and all the user IDs are in contoso.com, and you have configured accepted domains and proxy addresses for all mailboxes in contoso.net and contoso.org. To change the primary e-mail address of a user named Kim Akers with the user ID kakers@contoso.com to kim.akers@contoso.com and to keep the existing proxy addresses on the mailbox, run the following command: Set-Mailbox kakers@contoso.com -EmailAddresses SMTP:kim.akers@contoso.com,kakers@contoso.com,kakers@contoso.net, kakers@contoso.org
Free Windows Admin Tool Kit Click here and download it now
April 9th, 2012 8:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics