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 10th, 2009 2:48am

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 10th, 2009 5:56am

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 11:19am

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

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

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 8: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 22nd, 2009 2:13am

J Glad to help
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2009 3:53am

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

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

Other recent topics Other recent topics