18 thoughts on “Moving Mailboxes in Bulk to Office 365

  1. Hi Todd, I have just tried to run this process but I am getting he following error?
    Can not bind argument to parameter ‘Identity’ because it is null
    The CSV file is set out as follows:

    So the Identity field (Alias) should not be NULL?
    Do you have any suggestions…


  2. Hi Todd,
    I am trying to implement this procedure however I am getting the following error:
    Cannot bind argument to parameter ‘Identity’ because it is null.
    The .csv file is setup correctly:

    I have done a quick search but can not find any reference to this exact issue, do you have any suggestions?


      • Okay, so CU9.

        And you ran this command…

        $MAILBOXLIST = Import-CSV “C:\Userlist.csv”

        before this one…?

        foreach ($line in $MAILBOXLIST) {New-MoveRequest -Identity $line.alias -Remote -RemoteHostName hybridserver.domainname.com -TargetDeliveryDomain domainname.mail.onmicrosoft.com -RemoteCredential $ONPREMCREDS -BadItemLimit 1000}

        Also, you ran the commands from the Azure AD PowerShell Console and not the Exchange Management Shell?

        Are your on premise accounts synced to O365 via AAD Connect?

        If so, I’m not sure because I use these commands regularly.

      • Hi Todd,
        Yes to all questions? it is a strange one to be sure.
        Thanks for your quick replies. Maybe i’ll giggle with the script a little and see what is going on.

      • Strangely after running it again for the 5th time, that error is no longer present, but I then got a new error

        Turns out I had the FQDN of the hybrid server when I actually needed the auto discover URL name of mail.DomainName

        The three test mailboxes have now migrated successfully, but when I try a bigger list, I get the same original error??

      • Hi Todd, Sorry wrong terminology on my part, it is my OWA URL.
        I have managed to get the larger list migrating over at the moment.
        There must have been something wrong with the initial export CSV I was using as when I replaced the Alias’s from the export into the “test CSV file, they imported correctly.
        Thanks for all your assistance with this,
        Much appreciated.

  3. Script worked for me but i faced two different issue while running the bulk mailbox script.
    1. For multiple users i have to type down username & password multiple times.
    2. I couldnt able to run the script from powershell directly ,i have to type down the whole script manually then it worked.
    can you please let me know why so?

    • It probably indicates you entered the incorrect credentials for the on premises admin account for the command to set the variable (“$ONPREMCREDS = Get-Credential”). Or there is a typo in the command that begins with “foreach ($line in $MAILBOXLIST)”.

  4. HA! This is at least the third time I’ve ended up at your blog searching Google for something 365/Hybrid related issues Todd. Hope you’re doing well sir! – JJ

  5. Pingback: Exchange Online Migrations Tips & Tricks - NielsKok.Tech

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 )

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