So, you have come across a situation where you have to migrate users between Office 365 tenants. Its awfully painful and extremely tedious to recreate every single user... the good news is that O365 provides PowerShell modules that allow export users into a CSV file. We can then use the CSV to bulk import users into the new O365 tenant.
Here is a script to export users into a CSV :
# Connect to MSO Connect-MsolService # Get all users $users = Get-MsolUser $users | Select-Object -property @{name="User Name";Expression={$_.UserPrincipalName}}, @{name="First Name";Expression={$_.FirstName}}, @{name="Last Name";Expression={$_.LastName}}, @{name="Display Name";Expression={$_.DisplayName}}, @{name="Job Title";Expression={$_.JobTitle}}, @{name="Department";Expression={$_.Department}}, @{name="Office Number";Expression={$_.Office}}, @{name="Office Phone";Expression={$_.PhoneNumber}}, @{name="Mobile Phone";Expression={$_.MobilePhone}}, @{name="Fax";Expression={$_.Fax}}, @{name="Address";Expression={$_.StreetAddress}}, @{name="City";Expression={$_.City}}, @{name="State or Province";Expression={$_.State}}, @{name="Zip or Postal Code";Expression={$_.PostalCode}}, @{name="Country or Region";Expression={$_.Country}} | Export-Csv c:\users.csv -NoTypeInformation
Now use the Bulk Import feature on the new tenant to import the CSV as follows:
That's it!