none
New-MoveRequest from OnPrimes to o365 (Automatic provisioning isn't available for the "TargetDatabase") RRS feed

  • Question

  • Hi,

    I have an OnPremis Exchange 2007 that's integrated with o365 via Exchange 2010 CAS Server. I'm in the process of migrating all the users and I would like to create a scrip to move them batch by batch.

    I have created a script to work against a .csv file but it always says I have to specify the Database.

    I have consulted Microsoft o365 Support, it they are clearly mentioned a Database doesn't need to be mentioned in the script, as the mailboxes automatically will be moved to any database and the backend team will do the database cleanup by themselves...

    Below the script I've used.. any suggestion please?

    $Users = Import-Csv -Path C:\Scripts\Migration\MigrateMCP.csv
    $Users | ForEach-Object {New-MoveRequest -Identity $_.UserID}

    I also used this script, but same issue...

    Import-Csv -Path C:\Scripts\Migration\MigrateMCP.csv | % {New-MoveRequest -Identity $_.UserID -targetdatabase  -Verbose
    Automatic provisioning isn't available for the "TargetDatabase" mandatory parameter. A value must be explicited provide
    d for this parameter.
        + CategoryInfo          : InvalidData: (:) [], RecipientTaskException
        + FullyQualifiedErrorId : 8B2E2316
        + PSComputerName        : ExchangeCAS2010.Domain.Com

    Any help, would be greatly appreciated.

    Regards,

    Sunday, November 1, 2015 1:25 PM

Answers

  • Hi,

    I have an OnPremis Exchange 2007 that's integrated with o365 via Exchange 2010 CAS Server. I'm in the process of migrating all the users and I would like to create a scrip to move them batch by batch.

    I have created a script to work against a .csv file but it always says I have to specify the Database.

    I have consulted Microsoft o365 Support, it they are clearly mentioned a Database doesn't need to be mentioned in the script, as the mailboxes automatically will be moved to any database and the backend team will do the database cleanup by themselves...

    Below the script I've used.. any suggestion please?

    $Users = Import-Csv -Path C:\Scripts\Migration\MigrateMCP.csv
    $Users | ForEach-Object {New-MoveRequest -Identity $_.UserID}

    I also used this script, but same issue...

    Import-Csv -Path C:\Scripts\Migration\MigrateMCP.csv | % {New-MoveRequest -Identity $_.UserID -targetdatabase  -Verbose
    Automatic provisioning isn't available for the "TargetDatabase" mandatory parameter. A value must be explicited provide
    d for this parameter.
        + CategoryInfo          : InvalidData: (:) [], RecipientTaskException
        + FullyQualifiedErrorId : 8B2E2316
        + PSComputerName        : ExchangeCAS2010.Domain.Com

    Any help, would be greatly appreciated.

    Regards,

    I would probably initiate the migration from O365 Portal. Since you are doing a remote migration, O365 built-in migration tool will provide you the option to move the mailboxes via batches.

    OM (MCITP) | Blog

    Monday, November 2, 2015 1:49 PM

All replies

  • Hello Hussain I will suggest to migrate it from the O365 either powershell or in O365 ECP console. https://support.office.com/en-us/article/CSV-files-for-Mailbox-migration-b79fb81d-d6f4-4385-867e-7bdd0238366e

    Please mark as an answer if this answers your question .

    PREM RANA

    MCSE Exchange 2013, MCSA 2012 Server MCTS Exchange 2007,

    2010, MCITP Exchange 2007, 2010 MCSE 2003 Server,

    MCSA Exchange 2003 ITIL V3 Foundation

    https://ranaprem.wordpress.com/

    This posting is provided AS IS with no warranties and confers no rights.

    • Proposed as answer by Satyajit321 Wednesday, November 4, 2015 10:38 AM
    Sunday, November 1, 2015 1:39 PM
  • Hi Prem,

    The plan is to migrate those mailboxes from OnPremis Exchange to o365.

    Regards,

    Monday, November 2, 2015 5:14 AM
  • Hi Hussain,

    Prem is correct, you need to connect to O365 to be able to move the mailboxes. The server from where you would run will be in On-Premises only.

    Moving Individual Mailboxes to Office 365 via PowerShell

    You cmdlet seems to be missing lots of paramenters and switches -Remote -TargetDeliveryDomain

    #Run this command to initiate and run the bulk moves…
    New-MoveRequest -Identity "INSERT_USER_ALIAS_HERE" -Remote -RemoteHostName hybridserver.domainname.com -TargetDeliveryDomain domainname.mail.onmicrosoft.com -RemoteCredential $ONPREMCREDS -BadItemLimit 1000

    References:

    New-MoveRequest failed on Powershell and the same move Mailboxe is OK by EMC


    Regards,

    Satyajit

    Please “Vote As Helpful” if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

    Monday, November 2, 2015 10:32 AM
  • Hi,

    I have an OnPremis Exchange 2007 that's integrated with o365 via Exchange 2010 CAS Server. I'm in the process of migrating all the users and I would like to create a scrip to move them batch by batch.

    I have created a script to work against a .csv file but it always says I have to specify the Database.

    I have consulted Microsoft o365 Support, it they are clearly mentioned a Database doesn't need to be mentioned in the script, as the mailboxes automatically will be moved to any database and the backend team will do the database cleanup by themselves...

    Below the script I've used.. any suggestion please?

    $Users = Import-Csv -Path C:\Scripts\Migration\MigrateMCP.csv
    $Users | ForEach-Object {New-MoveRequest -Identity $_.UserID}

    I also used this script, but same issue...

    Import-Csv -Path C:\Scripts\Migration\MigrateMCP.csv | % {New-MoveRequest -Identity $_.UserID -targetdatabase  -Verbose
    Automatic provisioning isn't available for the "TargetDatabase" mandatory parameter. A value must be explicited provide
    d for this parameter.
        + CategoryInfo          : InvalidData: (:) [], RecipientTaskException
        + FullyQualifiedErrorId : 8B2E2316
        + PSComputerName        : ExchangeCAS2010.Domain.Com

    Any help, would be greatly appreciated.

    Regards,

    I would probably initiate the migration from O365 Portal. Since you are doing a remote migration, O365 built-in migration tool will provide you the option to move the mailboxes via batches.

    OM (MCITP) | Blog

    Monday, November 2, 2015 1:49 PM
  • Hi,

    Generally, there Is no TargetDatabase parameter during the migration from Exchange on-premises to Exchange Online. Instead, we should specify the TargetDeliveryDomain for Exchange Online.

    If you want to submit a new migration request for a batch of users from On-premises to Office 365, it is recommended to use New-MigrationBatch cmdlet:

    https://technet.microsoft.com/en-us/library/jj219166(v=exchg.160).aspx (Please refer to the Example 3)

    In your scenario, we can try the following command to move mailbox from on-premises to Online in a Hybrid Exchange environment:

    $Credentials = Get-Credential

    $MigrationEndpointOnPrem = New-MigrationEndpoint -ExchangeRemoteMove -Name OnpremEndpoint -Autodiscover -EmailAddress administrator@onprem.contoso.com -Credentials $Credentials

    $OnboardingBatch = New-MigrationBatch -Name RemoteOnBoarding1 -SourceEndpoint $MigrationEndpointOnprem.Identity -TargetDeliveryDomain cloud.contoso.com -CSVData ([System.IO.File]::ReadAllBytes("C:\Scripts\Migration\MigrateMCP.csv"))

    Start-MigrationBatch -Identity $OnboardingBatch.Identity

    Please note: if you want to use Powershell to do the mailbox migration, please Connect to Exchange Online using remote PowerShell  then run the script above to do the migration.

    Alternatively, we can do the mailbox migration in your Exchange 2010-based hybrid environment by using EMC in Exchange 2010:

    http://blogs.technet.com/b/exchange/archive/2013/08/29/hybrid-mailbox-moves-and-emc-changes.aspx


    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.




    • Edited by Roger Lu Tuesday, November 3, 2015 8:29 AM
    Tuesday, November 3, 2015 8:27 AM
  • Hi,

    I used the remote migration from the Office 365 Portal and that worked well..

    Also I used another script to apply the license for those students before I migrate their mailbox, just to make sure their remoteRoutingAddress is progegated properly.

    $AccountSkuId = "OrganizationName:OFFICESUBSCRIPTION_STUDENT"
    $UsageLocation = "BH"
    $Users = Import-Csv c:\Scripts\FY.csv
    $Users | ForEach-Object {
    Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
    Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId
    }

    Tuesday, November 3, 2015 10:14 AM
  • We all thought you wanted to use PowerShell instead. Anyways thanks for letting us know that you succeeded.


    Regards,

    Satyajit

    Please“Vote As Helpful” if you find my contribution useful or “MarkAs Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.


    • Edited by Satyajit321 Tuesday, November 3, 2015 10:25 AM
    Tuesday, November 3, 2015 10:24 AM
  • Hi Hussen

    I thought I have suggested the same thing, please check who all answer the similar and ,ark answer. Good for motivation.

    Thanks


    Please mark as an answer if this answers your question .

    PREM RANA

    MCSE Exchange 2013, MCSA 2012 Server MCTS Exchange 2007,

    2010, MCITP Exchange 2007, 2010 MCSE 2003 Server,

    MCSA Exchange 2003 ITIL V3 Foundation

    https://ranaprem.wordpress.com/

    This posting is provided AS IS with no warranties and confers no rights.

    • Proposed as answer by Soren Reisz Friday, June 7, 2019 12:24 PM
    • Unproposed as answer by Soren Reisz Friday, June 7, 2019 12:24 PM
    Tuesday, November 3, 2015 4:38 PM
  • See it's very long time ago, but Hussain Al Sayed you were very close... 

    Do this from you local Exchange hybrid, connect via powershell to your O365 tenant

    1. Create .csv file like below syntax

    EmailAddress

    Test@domain.com

    Test2@domain.com

    2. Now run the commands

    $Cred = Get-credential   = (for O365)

    $Users = Import-Csv -Path C:\test.csv

    $Users | ForEach-Object {New-MoveRequest -Identity $_.Emailaddress -Remote -RemoteHostName Hybridserver.onprem.com -TargetDeliveryDomain Office365Name.onmicrosoft.com -RemoteCredential $Cred -BadItemLimit 60 -SuspendWhenReadyToComplete:$False -WhatIf}

    (remove -Whatif) when you see it will create Move Request

    Important:

    -SuspendWhenReadyToComplete:$False <-- This switch moves the mailbox directly !!!

    If you need to finalize or control cutover at later point then use -SuspendWhenReadyToComplete:$True !!! and complete the Move Request when you decide to do it.

    Br.

    Soeren


    Friday, June 7, 2019 12:41 PM