Share via

Syncronizing users from contoso.onmicrosoft.com to contoso.com

Anonymous
2019-06-15T13:49:11+00:00

Hallo community. Here is my landscape:

we have an installation with approximately 200 users, who are using currently their .onmicrosoft,com domain to login and send receive mail. We have just deployed the required vanity domain  contoso.com. Both domain are visible to each user and domain addition completed successfully. 

We need now to allow users to login as ******@contoso.com instead of ******@contoso.onmicrosoft.com, and to send receive mail, keeping previous email mailbox, on the new contoso.com address.

Which is the best approach for doing it? 

thanks so much

Vmm

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2019-06-17T18:41:58+00:00

    Hello Vmm,

    Sorry for my late responding, I was out of office these days.

    You can try below method (multi-select users to update) to see if it works:

    There’s some PowerShell commands that admin can use for account management:

    1. To update user login name (UserPrincipleName), you may connect to Office 365 online PowerShell, and the main command is Set-MsolUser, you may compose several lines of script for bulk updating like (below sample isn’t strictly, please modify and use it for a test account firstly):

    $domain="contoso.com"

    Get-Msoluser | where-object {$_.UserPrincipalName.ToLower().EndsWith("onmicrosoft.com")} | Foreach-Object{

      $newUserPrincipalName= $_.UserPrincipalName.Split("@")[0] + "@" + $domain

      Set-MsolUserPrincipalName -UserPrincipalName $_.UserPrincipalName -NewUserPrincipalName $newUserPrincipalName

    }

    1. To update user SMTP address, the main command is Set-Mailbox, and you may connect to Exchange Online PowerShell to achieve this. For more information, please check below links:

    https://blogs.technet.microsoft.com/timmcmic/2015/05/17/office-365-bulk-update-email-addresses/

    Best Regards,

    Anna

    Was this answer helpful?

    10 people found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-06-15T14:23:18+00:00

    Hello Vmm,

    I suggest you may login Office 365 admin center to add alias (******@contoso.com) for each user, then set alias as Primary: https://support.office.com/en-us/article/Add-or-remove-a-user-s-email-alias-cb86b53b-bebf-4e0a-b781-c49270d85ea3

    In this way, user will be able to login via contoso.com and send emails from contoso.com, receive emails in contoso.com and contoso.onmicrosoft.com (after set alias as primary address, please do not delete the default .onmicrosoft.com address):

    Best Regards,

    Anna

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-06-20T07:41:02+00:00

    Hi Anna. sorry for the delay, was out on a trip.

    I will try the script in the next days and let you know how it went. It looks perfetc.

    thnaks so much for your support

    Marco

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-06-19T20:45:55+00:00

    Hello Vmm,

    Please feel free to contact me if you need any assistance.

    Best Regards,

    Anna

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-06-15T17:50:11+00:00

    Thanks so much, Anna!! It worked just fine. In the current version you don't need to push "set primary" button as you have a dbox telling you which is the account you should use at login.

    Now I need to to it for 200 users, or I can use a Powershell cmd to do it. Any suggestion for Powershell cmdlets to use?

    Thanks so much in the mean time. My problem is solved!

    Was this answer helpful?

    0 comments No comments