Skip to content

How to create Exchange online mailboxes for existing user accounts

December 3, 2013

How to create Exchange Online mailboxes for existing Active Directory user accounts in a hybrid environment

  1. Create account in Active Directory if it doesn’t already exist. Assign a routable UPN suffix.
  2. Force DirSync and wait for it to complete
  3. Confirm account appears in Microsoft Online Portal (MOP)
  4. Open Exchange Management Shell (EMS)
  5. Run the following command in EMS:

    Enable-RemoteMailbox {User_Name} -alias {Alias_Name} -RemoteRoutingAddress {Alias_Name}@{Tenant_Name}.mail.onmicrosoft.com
    

    For example:

    Enable-RemoteMailbox 365test1 -alias 365test1 -RemoteRoutingAddress 365test1@exitcodezero.mail.onmicrosoft.com
    

    Use quotes to enclose any value containing spaces. For example:

    Enable-RemoteMailbox "365 test2" -alias 365test2 -RemoteRoutingAddress 365test2@exitcodezero.mail.onmicrosoft.com
    
  6. Force DirSync and wait for it to complete
  7. Open Exchange Management Console (EMC)
  8. Confirm Remote User Mailbox exists in ‘Microsoft Exchange On-Premises’ organization
  9. Confirm User Mailbox exists in ‘Exchange Online’ organization. If not, force DirSync again and wait for it to complete
  10. Assign MSOL license
  11. Advertisements
2 Comments
  1. Terry permalink

    Hello – How could this be done by pulling 10 names at a time from a CSV file?

    Thank you!!

  2. julezmbi permalink

    $Users = Import-csv C:\Temp\EnableRemoteMailbox.csv
    $Users | ForEach-Object {Enable-RemoteMailbox -identity $_.userprincipalname -RemoteRoutingAddress ($_.samaccountname+’@TENANT.mail.onmicrosoft.com’)}

    The problem I just started to have in our hybrid environment is the following error.

    This task does not support recipients of this type. The specified recipient domain.com/Users/Remote/Stuff/365test2 is of type
    User. Please make sure that this recipient matches the required recipient type for this task.
    + CategoryInfo : InvalidArgument: (domain.com/User …Stuff/365test2:ADObjectId) [Enable-RemoteMailbox], RecipientTaskException
    + FullyQualifiedErrorId : [Server=MAILSERVERNAME,RequestId=757fde29-fcf8-4fe0-7a48-5bf296eb7a56,TimeStamp=3/29/2017 9:59:49 PM] [FailureCategory=Cmdlet-RecipientTaskException] 9B
    FA5BC4,Microsoft.Exchange.Management.RecipientTasks.EnableRemoteMailbox
    + PSComputerName : mailservername.domain.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: