How to Grant Access to another User’s OneDrive in Office 365?

Requirement: Grant access to OneDrive for business to another user.

OneDrive makes it easy to collaborate by sharing files and folders with others. By default, When the user creates SharePoint My Site or OneDrive site collection, SharePoint assigns the primary site collection administrator or the OneDrive Owner rights to the user. Sometimes, you may need to access another user’s OneDrive for Business site or share OneDrive with another user. E.g., The user left the company, and the manager of the user wants to gain access, backup purposes, compliance, delegation, security, etc. This article will walk you through how to give access to the OneDrive site to another user.

How to share OneDrive Files or Folders with another user?

If you want to share files or folders, You can browse to your OneDrive site from App launcher (or open OneDrive and right-click on the folder or file you intend to share). On top of the page, Select Share button, and then select “Specific people”. Enter the email address(es) of the people you want to share with and set the permission level to allow editing (can edit, can view, etc). This will grant permissions and send the recipient a sharing invitation email to access the shared folder or file.

onedrive give access to another user

Similarly, You can delegate some users to your OneDrive site with site permissions. Here is how:

  1. Navigate to the OneDrive site and click on the “Settings” icon. Click on “OneDrive settings” >> Click “More Settings”.
  2. Now click on “Return to the old Site settings page”.
  3. Under “Users and Permissions”, click on “Site permissions”
  4. Click on the “Grant Permissions” button on the ribbon and add the user who will get access.

Alright, How about sharing the entire OneDrive with another user?

Access Any User’s OneDrive site as a Global Administrator

If you have “Global Administrator” rights, follow these steps to access OneDrive for any user in the tenant:

  1. Log in to the Microsoft 365 Admin center at https://admin.microsoft.com/ as a global admin.
  2. Expand Users >> Active Users >> Search and find the user account to get OneDrive site access.
  3. Click on the user’s name to open the property pane >> Click on the OneDrive tab, then click the “Create link to files” link. This creates a link to the user’s OneDrive site and adds you as site collection administrator to that site.
    access another users onedrive site

What if you have only “SharePoint Admin” rights, but not a global administrator?

How to Grant Admin access to Another User on a OneDrive?

How to grant access to the OneDrive for Business site to another user? To gain access to a user’s OneDrive site, follow these steps:

  1. Login to SharePoint Online Admin Center.
  2. Click on the “More Features” and then the “User Profiles” link from the left navigation.
  3. Click on the “Manage User Profiles” link under the “People” group.
    change onedrive site collection administrator
  4. Search and pick the user profile to 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
  5. By default, The owner of the OneDrive site collection is listed as the Primary Site Collection Administrator and in Site Collection Administrators. (You can have only one primary site collection Admin!). Add any additional administrators to the site collection in the “Site Collection Administrators” field. You can change the primary site collection administrator as well as remove the owner from the user’s OneDrive account.
    change site collection administrator for onedrive site collection
  6. 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 manage access to the OneDrive site, you can use the PowerShell script to add administrator permissions to OneDrive for business sites.

How to Add a OneDrive site collection administrator?

To add a OneDrive site collection administrator, you can follow these steps:

  1. Navigate to the OneDrive site collection you want to manage (Assuming you have site collection admin rights on the OneDrive site).
  2. Click on Settings gear >> OneDrive Settings >> More Settings
  3. Click on the “Site Collection Administrator” link.
    onedrive site collection administrator
  4. Add the desired user as an admin.
    add onedrive site collection administrator

The person you added should now be able to access and manage settings, permissions, and admin features for that OneDrive site collection. You can follow these steps to remove a OneDrive site collection Administrator as well. More here: How to remove a one drive site collection administrator?

PowerShell to Add Site Collection Administrator to a OneDrive for Business Site Collection

If you need to access another user’s OneDrive for Business site, you’ll need to either change the site collection owner or add additional administrators to the site collection. Use this PowerShell script on SharePoint Online Management Shell to add an administrator to OneDrive for business.

#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!"

This PowerShell grants the owner access with full control to all OneDrive content to another user.

Grant Admin Access to All OneDrive for Business Sites

As there is no direct user interface to add a 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 the 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. By adding a user as a site owner or site collection administrator, you are granting full access to all the files and folders on the site. How about adding a new admin to all existing sites where a particular user was a site owner?

#Parameters
$TenantAdminURL = "https://crescent-admin.sharepoint.com"
$OldAdminID = "Salaudeen@crescent.com"
$NewAdminID = "Steve@crescent.com"

#Connect to SharePoint Admin Center
Connect-SPOService -url $TenantAdminURL

#Get All Sites where a particular user is owner
$Sites  =  Get-SPOSite -IncludePersonalSite $true -Limit All | Where {$_.Owner -eq $OldAdminID}

#Add NewAdmin as Site Collection Owner to all sites
$Sites | ForEach-Object { 
    Set-SPOUser -Site $_.Url -LoginName $NewAdminID -IsSiteCollectionAdmin $True
    Write-host "Added Site collection Admin to" $_.URL
}

PnP PowerShell to Grant OneDrive Access

Here is how to add OneDrive for Business site collection administrator with PowerShell:

#Set Runtime Parameters
$AdminSiteURL="https://crescent-admin.sharepoint.com"
$OneDriveSiteUrl="https://crescent-my.sharepoint.com/personal/sjackson_crescent_com"
$SiteCollAdmin="salaudeen@crescent.is"
 
#Connect to PnP Online
Connect-PnPOnline -Url $AdminSiteURL -Interactive

#Change OneDrive Ownership
Set-PnPTenantSite -Url $OneDriveSiteUrl -Owners $SiteCollAdmin

Similarly, You can add a site collection administrator to all OneDrive for business sites as:

#Set Parameters
$AdminSiteURL="https://crescent-admin.sharepoint.com"
$SiteCollAdmin="salaudeen@crescent.com"
 
#Connect to PnP Online to the Tenant Admin Site
Connect-PnPOnline -Url $AdminSiteURL -Interactive
 
#Get All OneDrive Sites
$OneDriveSites = Get-PnPTenantSite -IncludeOneDriveSites -Filter "Url -like '-my.sharepoint.com/personal/'"

#Loop through each site
ForEach($Site in $OneDriveSites)
{ 
    #Add Site collection Admin
    Set-PnPTenantSite -Url $Site.URL -Owners $SiteCollAdmin
    Write-Host -f Green "Added Site Collection Admin to: "$Site.URL
}
This PowerShell script only Adds given user as additional site collection administrators. Existing administrators will stay!

Summary

In summary, OneDrive offers flexible options to collaborate with others by granting access to your files and folders. You can choose to share with individuals through the web browser or from the OneDrive client application. For the entire OneDrive delegation, You can use Microsoft 365 Admin Center, SharePoint user profiles service, or PowerShell, as explained above. Whether you want to share documents with colleagues, share one drive with another user, or delegate one drive access, OneDrive has features to allow seamless sharing.

To remove OneDrive Site Collection Admin, use: How to Remove Site Collection Administrator from OneDrive?

What is a OneDrive site collection administrator?

A site collection administrator has full control and can access all content within the site collection, including private documents stored by users. So, A OneDrive site collection administrator is a user who has full control over a specific OneDrive for Business site collection. They can manage settings, permissions, and content within that site.

Can I have multiple site collection administrators for a OneDrive account?

Yes, you can have multiple site collection administrators for a OneDrive account. This can help distribute administrative responsibilities and ensure efficient management of the site collection.

How do I access deleted user’s OneDrive for Business?

Deleted user’s OneDrive sites are retained for 30 days or the number of days configured in the OneDrive retention and deletion policy. You can restore deleted OneDrive sites using the Restore-SPODeletedSite cmdlet in PowerShell.
More info: Restore OneDrive for Business Site

How do I give access to external Users in OneDrive?

External user access should be enabled at the tenant and site levels to provide access to OneDrive files and Folders. You can use either SharePoint Admin Center or PowerShell to achieve the same. More info: OneDrive for Business Guest Access

How do I share my entire OneDrive with another user?

You can add another user as a site collection administrator to your OneDrive for Business site to share the entire OneDrive.

Is there a way to transfer all OneDrive files to another account?

To transfer all OneDrive files to another account, you cannot do this directly through OneDrive’s interface. However, You can download all files from the source OneDrive account to your local computer and then upload them to the destination OneDrive account. PowerShell also helps!

Can anyone access my personal OneDrive?

Only you have direct access to your OneDrive site. Other users cannot access your OneDrive files without your permission. However, administrators in an organization can be granted access to a former employee’s OneDrive for the purpose of managing data.

Who can assign a OneDrive site collection administrator?

A Global Administrator, SharePoint Administrator, or Existing Site collection Admin of the OneDrive site can assign and remove site collection administrators to OneDrive.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

6 thoughts on “How to Grant Access to another User’s OneDrive in Office 365?

  • Are we able to set Grant Admin Access to All OneDrive for Business Site Collections script for a security group instead of a single user account?

    Set-SPOUser -Site $Site.Url -LoginName $SiteCollAdmin -IsSiteCollectionAdmin $True

    Thank you.

    Reply
  • First of all, thanks for this contribuition, it helped me a lot, awesome work!!

    Tested the one that would change for all sites and seemed to work, but I wonder, how could I use for example the first one that is meant to add to only one specific onedrive site, but instead I use it to multiples sites? is there a way to like, I add 4 or 5 specific sites in there, rather than run it individually for each site?

    Thanks!

    Reply
  • How can you modify this script to automate adding a user’s manager as secondary admin to only a list (.CSV file) of OneDrives

    Reply
  • How do I add O365 Group as secondary admin? The O365 group shows as ” member” in sharepoint GUI…

    Reply
      • Hi, Can your code be used to copy a departing user’s OneDrive for Business data to another user’s OneDrive? I have to perform this task manually when processing offboarding requests. I have struggled for weeks and still cannot make this work. Perhaps it cannot be done. Thanks for your time and input.

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *