locked
Creating Exchange Online mailbox for existing user in Local AD RRS feed

  • Question

  • Hi all,

    we have On-Premise Exchange 2013 and Exchange Online. Before we either create user account in AD, then from ECP create mailbox for user.

    Now Our Company plan to use Exchange Online and Office 365, but AD is on prem.If we create an account in AD,are there any Powershell command we can use to create mailbox for that user in Exchange online?

    Now we have to go through many steps and spend more time than before.

    Thanks!


    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. Thank you! Off2work


    • Edited by Off2work Saturday, September 13, 2014 12:06 AM edit
    Wednesday, August 13, 2014 9:36 AM

Answers

  • HI Matthew,

    sry for late reply,almost forgot about this thread.It is correct that enable-remotemailbox is working.

    Steps are as following:

    1.create user in AD (do not copy an existing object that already have exchange mailbox,since this will copy some exchange attributes which will cause error when running enable-remotemailbox)

    2.Run the following in Exchange powershell: Enable-RemoteMailbox "alias" –remoteroutingaddress Firstname.Lastname@domain.mail.onmicrosoft.com

    Reason to use -remoteroutingaddress is because its in Hybrid deployment,so remoterouting address should have onmicrosoft.com alias.

    3.Assign license for user.

    Offcourse there are other steps that needs to be done,but this varies from environment to environment.

    And Michael,as you mention it also works just to assign licens to user,but this will not create a remote routing address and mail flow will fail.In Hybrid environment a remote routing address is needed.

    Thanks!


    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. Thank you! Off2work


    • Marked as answer by Off2work Saturday, September 13, 2014 12:04 AM
    • Edited by Off2work Saturday, September 13, 2014 12:08 AM edit
    Saturday, September 13, 2014 12:03 AM
  • Look at the enable-remotemailbox PowerShell functionality to serve the purpose of creating mailboxes directly in Office 365 for on-premises AD accounts: http://technet.microsoft.com/en-us/library/ff607313(v=exchg.150).aspx
    • Proposed as answer by Matthew_Green Friday, August 29, 2014 4:12 PM
    • Marked as answer by Off2work Saturday, September 13, 2014 12:04 AM
    Friday, August 29, 2014 4:12 PM

All replies

  • I assume you will be running Forefront Identity Manager to synch on premise AD with online. 

    I use PowerShell scripts to manage my online accounts all the time. Many settings must be populated in AD and synched first. All this can also be done with Powershell. You will need to establish a remote Powershell session for most tasks:

    $LiveCred = Get-Credential
    
    $O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $LiveCred -Authentication Basic -AllowRedirection
    
    Import-PSSession $O365Session

    To set the regional location and add a license to an account:

    Connect-MsolService
    Set-MsolUser -Userprincipalname $ADEmployee.UserPrincipalName -UsageLocation US
    
    Set-MsolUserLicense -User $ADEmployee.UserPrincipalName -AddLicenses <domain>:EXCHANGEENTERPRISE 
    


    Tuesday, August 26, 2014 3:17 PM
  • Hi Michael,

    its not the License we want to assign,but Exchange online mailbox creation from an active user in local ad without mailbox.

    thanks!


    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. Thank you! Off2work

    Wednesday, August 27, 2014 9:42 AM
  • Assigning an appropriate license creates a mailbox. However, I believe the mailbox will not actually exist (that is, you can't run get-mailbox against it) until the user logs in to access it.
    Thursday, August 28, 2014 1:32 PM
  • Look at the enable-remotemailbox PowerShell functionality to serve the purpose of creating mailboxes directly in Office 365 for on-premises AD accounts: http://technet.microsoft.com/en-us/library/ff607313(v=exchg.150).aspx
    • Proposed as answer by Matthew_Green Friday, August 29, 2014 4:12 PM
    • Marked as answer by Off2work Saturday, September 13, 2014 12:04 AM
    Friday, August 29, 2014 4:12 PM
  • If I understand the OP, they have done away with their on premise Exchange? The documentation for that cmdlet states:

    This cmdlet is available only in on-premises Exchange Server 2013.


    Friday, August 29, 2014 4:47 PM
  • HI Matthew,

    sry for late reply,almost forgot about this thread.It is correct that enable-remotemailbox is working.

    Steps are as following:

    1.create user in AD (do not copy an existing object that already have exchange mailbox,since this will copy some exchange attributes which will cause error when running enable-remotemailbox)

    2.Run the following in Exchange powershell: Enable-RemoteMailbox "alias" –remoteroutingaddress Firstname.Lastname@domain.mail.onmicrosoft.com

    Reason to use -remoteroutingaddress is because its in Hybrid deployment,so remoterouting address should have onmicrosoft.com alias.

    3.Assign license for user.

    Offcourse there are other steps that needs to be done,but this varies from environment to environment.

    And Michael,as you mention it also works just to assign licens to user,but this will not create a remote routing address and mail flow will fail.In Hybrid environment a remote routing address is needed.

    Thanks!


    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. Thank you! Off2work


    • Marked as answer by Off2work Saturday, September 13, 2014 12:04 AM
    • Edited by Off2work Saturday, September 13, 2014 12:08 AM edit
    Saturday, September 13, 2014 12:03 AM