EdbMails EDB Recovery and Migration software
  • Products
    Exchange EDB / Email Recovery Tools
    • EDB Recovery and MigrationRecover EDB to PST, EDB to Office 365 and Exchange NO Duplicate Migration
    • OST Recovery and MigrationRecover OST to PST, OST to Office 365 and Exchange Migration
    • PST Recovery and MigrationRecover Outlook PST, PST to Office 365 and Exchange Migration
    • MBOX Export and MigrationExport MBOX to PST, MBOX to Office 365 and Exchange Migration
    • NSF Export and MigrationExport NSF to PST, NSF to Office 365 and Exchange Migration
    • EML to PST ExportEML files export to Outlook PST format
    • PST to MSG ExportOutlook PST files export to MSG format
    Exchange and Office 365 Migration
    • Exchange Server MigrationMigrate Exchange 2007, 2010, 2013, 2016, 2019 to Office 365 tenants. Also, migrate between Exchange servers and PST
    • Office 365 MigrationMigrate Source Office 365 tenants to Destination Office 365 tenants. Also, migrate to Exchange Server and PST
    • IMAP Email Backup & MigrationMigrate all IMAP email servers (Gmail, Zimbra, Zoho, Yahoo etc.), Office 365, Exchange and Backup to Outlook PST
    • SharePoint Online MigrationMigrate documents, files and folders from SharePoint sites
    • OneDrive for Business MigrationMigrate documents, files and folders from OneDrive
    • Microsoft Teams MigrationMigrate Teams, documents, files and folders etc.
    Exchange and Office 365 Backup
    • Office 365 BackupIncremental, Granular, Encrypted and Compressed Office 365 Mailboxes Backup
    • Exchange Server BackupIncremental, Granular, Encrypted and Compressed Exchange Mailboxes Backup
    • SharePoint, OneDrive & Teams BackupBackup Online site collections, Team sites, Office 365 groups, all documents etc.
    • Duplicate Remover - Office 365 & Exchange Remove duplicate emails, calendars, contacts, journal etc. from Office 365 and Exchange
    Go to products
  • Features
  • FAQ
  • Pricing
  • Download
  • Support
  • Sign in
User’s Manual
OndeDrive Migration

User Manual

User Manual

  • FAQ
    • SharePoint Migration
    • OneDrive Migration
    • Microsoft Teams Migration
    • Office 365 Migration
  • Videos
    • SharePoint Migration
    • OneDrive Migration
    • Microsoft Teams Migration
    • Office 365 Migration
  • Screenshots
    • SharePoint Migration
    • OneDrive Migration
    • Microsoft Teams Migration
    • Office 365 Migration
  • How it works?
    • SharePoint Migration
    • OneDrive Migration
    • Microsoft Teams Migration
    • Office 365 Migration
  1. Home
  2. Product
  3. Create OneDrive for Business Site Collections for All using PowerShell commands
Download Buy Now

Create OneDrive for business site collections for all users

For a successful OneDrive site migration in EdbMails, it's important to have the necessary OneDrive sites available on the target server. This can be achieved by creating OneDrive sites for all users on the target server, which ensures that the site collections are accessible for the migration process.

In addition, granting admin access to all OneDrive for Business site collections on both the source and target servers is necessary to ensure that the migration process has the required permissions to access and transfer data from the site collections.

Commands to create OneDrive sites on the target server

Run the below PowerShell commands as an administrator to create the OneDrive sites on the target server for all the users

Command 1:

Command: Copy

Install-Module -Name ExchangeOnlineManagement -Scope AllUsers

Command 2:

Command: Copy

Connect-ExchangeOnline

Command 3:

Command: Copy

Get-EXOMailbox -ResultSize Unlimited | Select-Object PrimarySmtpAddress | export-csv C:\\users.csv

Command 4:

Command: Copy

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

Command 5:

Command: Copy

Import-Module Microsoft.Online.SharePoint.PowerShell

Command 6:

Command: Copy

Connect-SPOService -Url https://<your_tenant>-admin.sharepoint.com

Replace <your_tenant> with the name of your server Microsoft 365 tenant

Command 7:

Command: Copy

$Users = Import-CSV C:\users.csv

Command 8:

Command: Copy

ForEach ($User in $Users) { Request-SPOPersonalSite -UserEmails $User.PrimarySmtpAddress -NoWait }

The above script is designed to create OneDrive for Business site collections for each user specified in a CSV file. Each site collection's URL will be in the format of https://<your_tenant>-my.sharepoint.com/personal/<user_upn>, where "<your_tenant>" is the name of your Microsoft 365 tenant and "<user_upn>" is the user principal name of each user. The owner of each site collection will be set to the corresponding user specified in the CSV file.

Grant admin access to all OneDrive for business site collections

Granting administrative access to all OneDrive for Business site collections allows a specified user to manage user permissions and settings for multiple site collections at once. This enables the user to perform administrative tasks across multiple site collections more efficiently, saving time and effort.

Commands to grant admin access to all OneDrive for business site collections

Run the below PowerShell commands as an administrator for both source and target servers

Command 1:

Command: Copy

Install-Module -Name ExchangeOnlineManagement -Scope AllUsers

Command 2:

Command: Copy

Connect-ExchangeOnline

Command 3:

Command: Copy

Get-EXOMailbox -ResultSize Unlimited | Select-Object PrimarySmtpAddress | export-csv C:\\users.csv

Command 4:

Command: Copy

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

Command 5:

Command: Copy

Import-Module Microsoft.Online.SharePoint.PowerShell

Command 6:

Command: Copy

Connect-SPOService -Url https://<your_tenant>-admin.sharepoint.com

Replace <your_tenant> with the name of your server Microsoft 365 tenant

Command 7:

Command: Copy

$o365login = "<info@domain.onmicrosoft.com>"

Replace the email address <info@domain.onmicrosoft.com> with your actual email address

Command 8:

Command: Copy

Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | select Url | export-csv C:\\sites.csv

Command 9:

Command: Copy

$Sites = Import-CSV C:\sites.csv

Command 10:

Command: Copy

ForEach ($Site in $Sites) { Set-SPOUser -Site $Site.Url -LoginName $o365login -IsSiteCollectionAdmin $true }

Click here to know the steps to migrate OneDrive sites using EdbMails

 In this manual

Commands to create OneDrive sitesGrant admin access to all OneDrive

OneDrive Migration

Just 10 Sites $80 Only

Buy Now

Need help?

24/7 Customer support

Contact us on Live chat

Personalized Demo

Book a personalized demo

Still need help?

Email us / Call us

@edbmails.com All rights are reserved Privacy Policy | Terms of Use | GDPR | Security | Press Releases

hidden msg
Live Chat

Hi, May I help you?

Hide Chat Now