set external smtp adress as primary

Posted on 2012-08-27
Last Modified: 2012-09-01
Hi experts,

I'm using a custom made script which imports contacts in AD.
After the import I can see the contacts in Exchange but the e-mailadresses are set as external smtp adresses. Is there a way with powershell or gui to set external smtp adresses to primary smtp adresses? I can do this manually by copying the external smpt adress, choose add and then smtp and choose paste. I receive a notification “the object must be upgrade to the current Exchange version. After the upgrade the object cannot be managed by an earlier version….” Unfortunately I have to this for 3000+ contacts.

I already used this command to upgrade all the contacts to Exchange 2010.

Get-MailContact -resultsize Unlimited | Set-MailContact -CustomAttribute1 Update

But now I still have to find a quick way to set the external smtp as primary.

Please help!

Kind regards,

Lennaert van der Meer
Question by:KNBsysteembeheer01
    LVL 52

    Assisted Solution

    Primary SMTP always shows as SMTP .... whereas secondary shows as smtp :)

    Hope this might help
    $addrs = import-csv addrs.csv

    foreach ($addr in $addrs){
    $contact = get-recipient $addr
    set-mailcontact $contact -externalemailaddress $contact.primarystmpaddress

    - Rancy

    Author Comment

    Hi Rancy,

    Thanks for your quick reply but I looks like your solution is just the other way around.
    I need to set my external smtp adress as primary. Instead of my primary as external.

    See screenshot.

    Accepted Solution

    Woohoo, found the solution.

    This was my procedure.

    After importing the contacts I used powershell:

    Get-MailContact -resultsize Unlimited | Set-MailContact -CustomAttribute1 Update

    Than I selected all of my contacts and marked the box: Update E-Mail Addresses Based on Recipient Policy.

    After that all of my contacts where corrected.
    LVL 52

    Expert Comment

    LVL 16

    Expert Comment

    by:Rajitha Chimmani
    You can try below.

    $Contacts = Get-MailContact -resultsize Unlimited
    foreach($contact in $Contacts){
    [string]$ExternalSMTPAddress = $Contact.ExternalEmailAddress.SMTPaddress
    Set-MailContact $contact.Name -PrimarySMTPAddress $ExternalSMTPAddress

    Author Closing Comment

    I found the solution but Rancy pointed me to the right sites to find it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Use email signature images to promote corporate certifications and industry awards.
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    This tutorial will walk an individual through the process of upgrading their existing Backup Exec 2012 to 2014. Either install the CD\DVD into the drive and let it auto-start, or browse to the drive and double-click the Browser file: Select the ap…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now