You don't need to do all that work anymore. In a recent update to the [SharePoint Online Management Shell][1], there is a commandlet to do this for you with much less effort.

It is `Request-SPOPersonalSite`. You can enqueue up to 200 OneDrive for Business sites at a time.

    $emails = "[email protected],[email protected]"
    Request-SPOPersonalSite -UserEmails $emails

If you are going to do batches of 200 at a time, it is recommended to use the `-NoWait` switch.

    Request-SPOPersonalSite -UserEmails $emails -NoWait

https://technet.microsoft.com/en-us/library/dn792367.aspx


  [1]: https://www.microsoft.com/en-us/download/details.aspx?id=35588