How to create Exchange online mailboxes for existing user accounts
How to create Exchange Online mailboxes for existing Active Directory user accounts in a hybrid environment
- Create account in Active Directory if it doesn’t already exist. Assign a routable UPN suffix.
- Force DirSync and wait for it to complete
- Confirm account appears in Microsoft Online Portal (MOP)
- Open Exchange Management Shell (EMS)
-
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
- Force DirSync and wait for it to complete
- Open Exchange Management Console (EMC)
- Confirm Remote User Mailbox exists in ‘Microsoft Exchange On-Premises’ organization
- Confirm User Mailbox exists in ‘Exchange Online’ organization. If not, force DirSync again and wait for it to complete
- Assign MSOL license
Advertisements
Hello – How could this be done by pulling 10 names at a time from a CSV file?
Thank you!!
$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