kwizcom banner advertisement

How to Gain Owner Access to OneDrive for Business Sites in Office 365?

By default, When SharePoint My Site or OneDrive site collection is created by the user, SharePoint assigns primary site collection administrator rights to the user. In some cases you might need to gain Admin access to a OneDrive for Business site of a user. E.g. User left the company and manager of the user wants to gain access, Backup purposes, compliance, security, etc.

How to get admin access to the OneDrive for Business site in Office 365?
To gain access to a user's OneDrive site, follow these steps:
  • Login to SharePoint Online Admin Center
  • Click on "User Profiles" link from left navigation >> Click on "Manage User Profiles" link under "People" group
    change onedrive site collection administrator
  • Search and pick the user profile which you want to gain access. From the search result, Click on the menu item "Manage site collection owners" from the context menu.
    Add administrator to onedrive for business in office 365
  • Add any additional administrators to the site collection in "Site Collection Administrators" field. You can change the primary site collection administrator as well.
    change site collection administrator for onedrive site collection
  • Click on "OK" to commit your changes!
Now, you can gain access to all files and folders for the particular user. Instead of manually doing these steps to gain access to OneDrive site, you can use PowerShell script to add administrator permissions to OneDrive for business sites.

PowerShell to Add Site Collection Administrator to OneDrive for Business Site Collection:
Use this PowerShell script on SharePoint Online Management Shell.
#Set Runtime Parameters
$AdminSiteURL="https://crescent-admin.sharepoint.com"
$OneDriveSiteUrl="https://crescent-my.sharepoint.com/personal/biadmin_crescent_com"
$SiteCollAdmin="salaudeen@crescent.com"

#Get Credentials to connect to SharePoint Admin Center
$Cred = Get-Credential

#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL –credential $Cred

#Add Site Collection Admin to the OneDrive
Set-SPOUser -Site $OneDriveSiteUrl -LoginName $SiteCollAdmin -IsSiteCollectionAdmin $True
Write-Host "Site Collection Admin Added Successfully!"

Add Site Collection Admin to All OneDrive for Business Site Collections
As there is no direct user interface to do add site collection administrator to OneDrive for business sites, Here is the PowerShell script you can utilize to add additional administrators in bulk.
#Set Runtime Parameters
$AdminSiteURL="https://crescent-admin.sharepoint.com"
$SiteCollAdmin="SPAdmin@crescent.com"

#Get Credentials to connect to SharePoint Admin Center
$Cred = Get-Credential

#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL –credential $Cred

#Get all OneDrive for Business Site collections
$OneDriveSites = Get-SPOSite -Template "SPSPERS" -Limit ALL -IncludePersonalSite $True
Write-Host -f Yellow "Total Number of OneDrive Sites Found: "$OneDriveSites.count

#Add Site Collection Admin to each OneDrive
Foreach($Site in $OneDriveSites)
{
    Write-Host -f Yellow "Adding Site Collection Admin to: "$Site.URL 
    Set-SPOUser -Site $Site.Url -LoginName $SiteCollAdmin -IsSiteCollectionAdmin $True
}
Write-Host "Site Collection Admin Added to All OneDrive Sites Successfully!" -f Green

This script adds site collection admin to all OneDrive for business site collections.
How to Gain Owner Access to OneDrive for Business Sites in Office 365? How to Gain Owner Access to OneDrive for Business Sites in Office 365? Reviewed by Salaudeen Rajack on April 29, 2017 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.