Provision OneDrive and set global administrator for OneDrive accounts in Office365


Recently I was working in a project to migrate all the SharePoint on-premise stuffs to Office365 including file shares. All the users had their on file shares mapped to their home drives on the PC. And the requirement is to move all the home drive data to OneDrive for Business and let the Global administrators to manage them efficiently.

Though Office 365 admin page have functionality to set Global admin for SharePoint sites, for OneDrive sites there is no OOB way to set a Global admin for all the sites. And its very tedious to set this manually for 400+ users.

Below script will help the IT pro’s to

1) Store the Office admin credentials

2) Provision OneDrive Sites for list of users

3) Assign administrator for provisioned OneDrive sites


try
{
  Get-MSOLCredentials
  Create-OneDriveSites
  Assign-Administrator
}

Download the script and change the Variables in “Input Variables” section to suit your environment


#Input Variables Begin
 #Credentials Store Location
 $credFile="C:\scripts\spbreed04cred.xml"
 #Log File location
 $Logfile = "C:\GG\OneDriveProvisionReport.log"
 #O365 Global admin
 $O365AdminAccount = "admin@spbreed04.onmicrosoft.com";
 #O365 Onedrive admin
 $OneDriveAdminAccount = "admin@spbreed04.onmicrosoft.com";
 #O365 Admin site URL
 $webUrl = "https://spbreed04-admin.sharepoint.com"
 #List of OneDrive users (seperated by CSV)
 $OneDriveUsers = "alans@spbreed04.onmicrosoft.com","admin@spbreed04.onmicrosoft.com" 
# Input Variables End

Click here the download the script.

Advertisements

5 thoughts on “Provision OneDrive and set global administrator for OneDrive accounts in Office365

  1. Pingback: SharePoint 2013: Recopilatorio de enlaces interesantes (LX)! - Blog de Juan Carlos González en Geeks.MS

  2. Hello, nice post. However i’m wondering if you have the Powershell version of this script. I’m searching for a powershell script that Pre-provisions OneDrive for New users. ANy help will be appreciated.

    Many thanks
    Ola

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s