Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dev-kperera/be1d2bd41a488b3aea1410085f0cab35 to your computer and use it in GitHub Desktop.
Save dev-kperera/be1d2bd41a488b3aea1410085f0cab35 to your computer and use it in GitHub Desktop.
Script to provision OneDrive personal sites using ShareGate PowerShell libraries. More information: https://support-desktop.sharegate.com/hc/en-us/articles/115000641328-Get-OneDrive-URL
# Connect to Office 365
$tenant = connect-site -Url https://tenant-admin.sharepoint.com -Browser
# Get list of emails
$eMailCSV = "C:\emailList.csv"
$table = Import-Csv $eMailCSV -Delimiter ";"
# Iterate through emails and provision OneDrive sites
foreach ($row in $table) {
Get-OneDriveUrl -Tenant $tenantMoravia -Email $row.email -ProvisionIfRequired
}
<#
By default, the first time that a user browses to their OneDrive it's automatically provisioned for them. In some cases, such as the following, you might want your users' OneDrive locations to be ready beforehand, or pre-provisioned
More information:
https://docs.microsoft.com/en-us/onedrive/list-onedrive-urls
https://support-desktop.sharegate.com/hc/en-us/articles/115000641328-Get-OneDrive-URL
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment