How to get administrative access to the OneDrive for Business environment of a user

How to get administrative access to the OneDrive for Business environment of a user

In some cases you might need administrative access to a OneDrive for Business environment of a user. Yesterday, for example, I had to make a backup of a couple of OneDrive for Business instances. As you might know, OneDrive for Business is SharePoint Online under the hood. By default only the user has administrative rights of their OneDrive for Business, it is personal storage after all. If you open OneDrive for Business for another user you will only see files that are shared with you or Everyone as you can see below:

No Administrative Access OneDrive for Business

No Administrative Access OneDrive for Business

 

If you are familiar with SharePoint Online you might recognize some of these steps to get administrative access.

  • Go to the Office 365 admin portal
  • Open the SharePoint admin center
  • On the left choose user profiles
  • Manage User Profiles
  • Administrative Access OneDrive for Business Manage User Profiles

    Manage User Profiles

  • Find the user you would like to have access to
  • Open the item menu of the user
  • Manage site collection owners
  • Administrative Access OneDrive for Business Manage User Profiles Item Menu

    Administrative Access OneDrive for Business Manage User Profiles Item Menu

  • Add your administrator account
  • Administratice access OneDrive for Business Site Collection Admin

    OneDrive for Business Site Collection Admin

After executing the steps above, you will see all files and folders for the current user:

Administrative access OneDrive for Business

Administrative access OneDrive for Business

Another option to add your admin account to the OneDrive for Business site collection of the user is using Windows PowerShell. Make sure you are connected to SharePoint Online before executing the scripts below. You can do this easily with the scripts provided in another blogpost Easily manage multiple Office 365 tenants with Windows PowerShell.

https://gist.github.com/eugenedauphin/b6ac8e787a9deae57c93

By | 2017-01-04T12:24:23+00:00 January 21st, 2015|Office 365|6 Comments
  • Qazi Arfeen

    Thank you very much for sharing the script. For others to know I was able to run it using SharePoint Online Management Shell which I got from http://www.microsoft.com/en-au/download/details.aspx?id=35588.
    Another thing is that after installing I ran it as Administrator
    Lastly when I tried to run the script I got an error that its not connected to any site collection.
    I first ran the command Connect-SPOService to connect to my site collection https://aaa-admin.sharepoint.com and then was able to run the above script.
    Thank you very much

    • Thanks for your feedback, nice to hear that this post was useful to you. You can also use my scripts to connect to multiple Office 365 tenants easily.

  • Peter Filbin

    Hi Eugene,
    I’m trying to find a script that will remove all admin access to each user’s OneDrive (we are trying to shut OneDrive down). This is the closest thing I’ve come across but it doesn’t quite do what I’m needed. Plus it’s only for 1 user at a time.

    How would I go about doing this for every user all at once?

    • You could iterate through all the OneDrive for Business sites (https://technet.microsoft.com/en-us/library/dn911464.aspx) and change the owner: Set-SPOSite -Identity $site -Owner . This will prevent users to create files.

    • Andy John

      Hey Peter,
      I have a similar problem as you do. I want to remove the OneDrive access from one person, that has access to each user’s OneDrive. Did you found a solution yet?

  • Aaron Schell

    I found that this doesnt actually do anything. I followed these steps exactly and none of the users files show up when I login.