4 Ways to Add a Secondary Administrator to OneDrive for Business

OneDrive forBiz rgb EN Blue

Adding a secondary administrator to OneDrive For Business (ODFB) in Office 365 is a very common ask that from time to time you, as an Office 365 Administrator, might be asked to do. This would be so another user (or yourself) can take the ownership of a user’s ODFB. At times, there is a requirement to take the control of another’s data. Fortunately, this task can be achieved in at least 4 different ways as I will demonstrate in this article:

  • By means of the Office 365 Admin Center
  • By using the SharePoint Online (SPO) User profiles service settings in the SPO Administration
  • By means of PowerShell using SPO standard cmdlets
  • By means of PowerShell using SPO Client Side Object Model (CSOM)

 

 

Adding a Secondary Administrator to User’s ODFB from the Office 365 Admin Center

As an Office 365 Administrator, you can easily take the ownership of an existing user’s ODFB by using the “Access files” option available when selecting a user in the Users Management section:

  • Browse Office 365 Administration portal and then go to the Users Management section. In the users’ list, just select an existing user so that the user’s details panel is shown. In the user’s detail panel, scroll down until you see the OneDrive settings section that allows you to become the administrator of the user’s OneDrive by simply clicking on Access files link.

Figure 1

Figure 1 — OneDrive Settings Section in the Users’ Details Panel

Once you click on the Acces files link, you will see a link to the user’s OneDrive that will allow you to browse user’s OneDrive as a secondary administrator.

 

Figure 2
Figure 2 — Link to user’s ODFB

 

If you click user’s OneDrive link, you will get access to user’s OneDrive with administration privileges.

 

Figure 3

Figure 3 — Accessing User’s ODFB as Secondary Administrator

 

Adding a Secondary Administrator to User’s ODFB from the SPO Admin Center

As you surely know, ODFB is totally based on SPO platform. That means there are some configuration options for ODFB that are available through SPO Administration. Indeed, you can manage some ODFB settings by means of the SPO User Profiles services such as adding a secondary administrator to user’s ODFB:

First, browse SharePoint Online (SPO) Admin Center and click on User profiles link available in the vertical menu. In the User profiles page, just click on Manage User Profiles.

Figure 4
Figure 4 — Getting Access to the User Profiles Management in SPO

 

In the Manage User Profiles page, just search for a specific user and display the administration options available for managing that user profile. Click Manage site collection owner’s option.

Figure 5
Figure 5 — Manage Site Collection Owner’s Option

 

In the Manage site collection owner’s window that is displayed, just add/delete a secondary administrator for the user’s OneDrive. Note that in my case, I have just edited the same user I had granted access to his ODFB through the user’s detail panel in the Office 365 Admin Center.

Figura 6

Figure 6 — Adding a Secondary Administrator to ODFB from the SPO User Profiles Management

Adding a Secondary Administrator to ODFB Using SPO Cmdlets

PowerShell provides an alternative path to work with SPO and ODFB, so an Office 365/SPO Administrator only needs some lines of PowerShell code and some of the default SPO cmdlets to make changes as adding a secondary administrator to ODFB. Indeed, this operation can be done by means of the Get-SPOSite standard cmdlet as detailed bellow:

$ssODFBSite="<ODFB_Site_Url>"
$sSecondaryODFBAdmin ="<O365_User_To_Add>"
Set-SPOUser -Site $sODFBSite -LoginName $sSecondaryODFBAdmin -IsSiteCollectionAdmin $true

For your convenience, you can download a more complete PowerShell script from the PowerShell TechNet Script Gallery: How to Add a Secondary Administrator to a User’s ODFB.

 

Adding a Secondary Administrator to ODFB Using CSOM

Finally, there is a way to add a secondary administrator to ODFB. This is done by means of SPO CSOM API that you can use in a regular .NET application (for instance, a simple console application) or in a PowerShell script. As an example, the following PowerShell code shows you how to add a secondary administrator to ODFB using CSOM:

$ssODFBSite="<ODFB_Site_Url>"
$sSecondaryODFBAdmin ="<O365_User_To_Add>"
$spoCtx = New-Object Microsoft.SharePoint.Client.ClientContext($sODFBSite) 
$spoCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($sUserName, $sPassword) 
$spoCtx.Credentials = $spoCredentials 
$spoUser=$spoCtx.Web.EnsureUser($sSecondaryODFBAdmin) 
$spoUser.IsSiteAdmin=$true 
$spoUser.Update() 
$spoCtx.Load($spoUser) 
$spoCtx.ExecuteQuery()

For your convenience, you can download a more-complete PowerShell script from the PowerShell TechNet Script Gallery: How to Add a Secondary Administrator to a User’s ODFB (CSOM Edition).

Conclusions

Adding a secondary administrator to a user’s ODFB can be achieved in at least 4 different ways taking advantage of both Office 365 and SPO Administration UIs and PowerShell code where SPO standard cmdlets or CSOM API can be used.

 

Juan Carlos González Martín
Office Servers and Services MVP
Cloud & Productivity Advisor
[email protected]
@jcgm1978 | https://jcgonzalezmartin.wordpress.com/