SharePoint Pals
 | Sign In
How To Pre-Provision OneDrive For Business For Users In SharePoint Online
by Sriram Varadarajan 16 Apr 2016
Enterprise Architect
Today  :   2     Total  :    3958

As of now, OneDrive for business (ODFB) get provisioned Just In time, but our requirement is to get that pre-provisioned. Follow the below steps to pre-provision ODFB for specific accounts.


A PowerShell command-let for SharePoint is available to do this, but before executing this command-let  verify the following:

1. Does the user exists in SharePoint tenant and it’s active
2. Verify whether a valid 0365 license is associated to the user.

Once verified, follow the below Steps

1. Install SharePoint management shell.

2. Execute command

 Enter GA credential
 $emails = ","
 Request-SPOPersonalSite -UserEmails $emails


This command-let will not show a success/failure error message
Will take a maximum of 30 min to provision an ODFB.
We can provision ODFB for 200 users in one go (but nothing more)


Please execute the script, to verify whether ODFB provisioning.

 #Specify tenant admin
 $User = ""
 $Log = "c:\Log.csv"
 $Users = Get-Content D:\Users.txt
 #Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
 Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
 Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
 Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.UserProfiles.dll"
 $Password = Read-Host -Prompt "Please enter your password" -AsSecureString
 $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
 #Configure MySite Host URL
 $SiteURL = ""
 #Bind to Site Collection
 $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
 $Context.Credentials = $Creds
 #Create People Manager object to retrieve profile data
 $PeopleManager = New-Object Microsoft.SharePoint.Client.UserProfiles.PeopleManager($Context)
 Foreach ($User in $Users)
     $UserProfile = $PeopleManager.GetPropertiesFor("i:0#.f|membership|" + $User.Split(" ")[2])
     ($User.Split(" ")[2]) + "," + $UserProfile.UserProfileProperties.'SPS-PersonalSiteCapabilities' | Out-File -Encoding Default -FilePath $Log -Append
     If ($UserProfile.UserProfileProperties.'SPS-PersonalSiteCapabilities' -eq "0")
              Write-Host "i:0#.f|membership|" - ($User.Split(" ")[2]) -ForegroundColor Red
blog comments powered by Disqus

SharePoint Pals

SharePoint Pals, a community portal for SharePoint developers, Administrators and End Users. Let's join hands and share the point together.
Read this on mobile


Angular Js Training In Chennai
Advanced Angular Js training with real world developer scenarios
Angular Js, Web Api and Ionic for .Net Developers
All in one client side application development for .Net developers
Angular Js For SharePoint Developers
Get ready for the future. Its no more just C#

Get Connected

SharePoint Resources

SharePoint 2013 and 2010 Web Parts
Free Web Parts with Source Code for SharePoint Community

SharePoint 2013 Books and Tutorials
Collection of free SharePoint 2013 books and tutorials (eBooks, pdfs)

Supported By

Contribute your article and be eligible for a one month Free Subscription for Plural Sight. The Author of the most popular New Article (published in the previous month) will be awarded with a Free One month Plural Sight Subscription. Article can be sent to in a word document.

Related Resources

Recent Tweets

Twitter January 15, 00:25
How To Enable Target Value And Actual Value In #D3 Gauge Chart

Twitter January 15, 00:24
How To Open #SharePoint List Hyperlink Column In Modal #Popup Window

Twitter January 15, 00:24
Quick Introduction To #Asp.NetCore And It’s Features

Twitter January 15, 00:22
How To Configure #PerformancePoint Services To Use Secure Store In #SharePoint 2013

Twitter January 15, 00:21
How To Block Or Disable #Office365 Services

Follow us @SharePointPals
Note: For Customization and Configuration, CheckOutRecent Tweets Documentation