Get All SharePoint Online Administrators in Office 365 using PowerShell

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

How to Get All SharePoint Online Administrators in Office 365?

As a SharePoint Online administrator, you may need to get a list of all other SharePoint Online administrators in your Office 365 environment. There are a few ways you can do this, and this article will show you how to get all SharePoint Online administrators in Office 365.

To view all existing SharePoint admins, do the following:

  • Login to Microsoft Admin Center https://admin.microsoft.com
  • 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 the 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 has admin rights on SharePoint Online. So, Here is the PowerShell to get all SharePoint Online Administrators:

#Connect to Azure AD
Connect-AzureAD
 
#Parameters
$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. I assume you have been assigned the global administrator role in Office 365. 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 - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published.