locked
Rename Primary SMTP address RRS feed

  • Question

  • I have to change primary smtp address of few Distribution List on Exchange 2007 server.

    e.g i have a DL called Test@abc.com and created new DL Test1@abc.com.
    Now i want to hide Test@abc.com and rename it's primary smtp address to Testzzz@abc.com and assign Test@abc.com to new DL Test1@abc.com and make it primary leaving test1@abc.com as secondary.

    I have a script which hides the old dl making all the changes i want except renaming email address.

    Whenever i try to rename Test@abc.com to testzzz@abc.com it adds testzzz@abc.com and makes it primary and test@abc.com as secondary.

    I am still a beginer in PS scripting so need you help urgently.

    Below is the script i am using.

    Import-CSV .\DLs.csv | foreach {Set-DistributionGroup $_.email -Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -WindowsEmailAddress $_.WindowsEmailAddress -SamAccountName $_.SamAccountName -EmailAddressPolicyEnable $False}


    Shahid

    Tuesday, December 11, 2012 4:29 AM

Answers

  • It works when i change it manually.

    I used -EmailAddresses parameter it worked. But the only problem is it removes all other proxy addresses from the group.


    Shahid

    Friday, December 14, 2012 5:05 AM

All replies

  • Hi

    The Set-DistributionGroup cmdlet has a PrimarySmtpAddress parameter which you can specify.

    Have a look at the Parameters section of this article: http://technet.microsoft.com/en-us/library/bb124955%28v=exchg.80%29.aspx.

    Cheers, Steve

    Tuesday, December 11, 2012 8:05 AM
  • Thanks for response Steve.

    I already tried that parameter and that too doesn't work.


    Shahid

    Tuesday, December 11, 2012 9:22 AM
  • Does this work manually - if you try to change the primary SMTP yourself without the script?

    If not, I suspect the "Automatically update email addresses based on email address policy" may be checked.

    Try unchecking that and see if that helps.


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

    Wednesday, December 12, 2012 7:47 PM
  • It works when i change it manually.

    I used -EmailAddresses parameter it worked. But the only problem is it removes all other proxy addresses from the group.


    Shahid

    Friday, December 14, 2012 5:05 AM