Get All SharePoint Online Administrators in Office 365 using PowerShell

Requirement: Get a list of All users with SharePoint Online Administrator Role.

How to Get All SharePoint Online Administrators in Office 365?

To view all existing SharePoint admins, do the following:

  • Login to Microsoft Admin Center
  • Click on “Show All” in the left navigation >> Click on the “Roles” link
  • Under Roles click on “SharePoint Admin” >> Click on the “Assigned Admins” tab in the details pane.
    get all sharepoint online administrators in office 365

This gets you all SharePoint Admins of the tenant. Please note, Global admin rights include the SharePoint Online Admin role as well!

Get All SharePoint Online Administrator in Office 365 tenant using PowerShell:

As a regular security audit, we wanted to generate a report of who is having admin rights on SharePoint Online. So, Here is the PowerShell to get all SharePoint Online Administrators.

#Connect to Azure AD
$RoleName="SharePoint Service Administrator"

#Get the Role
$Role = Get-AzureADDirectoryRole | Where {$_.DisplayName -eq $RoleName}

#Get All Members of the Role
Get-AzureADDirectoryRoleMember -ObjectId $Role.ObjectId | Select DisplayName, UserPrincipalName

This script would give a prompt to enter your credentials.

Here is my other post on adding new SharePoint Online Administrators in Office 365: How to Add New SharePoint Online Administrator?

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply