Requirement: Get All SharePoint Online Administrators of the Office 365 tenant.
How to Check If a User is SharePoint Online Administrator in Office 365?
To find if a user is SharePoint Online Administrator, do the following:
- Login to Office 365 Admin Center: https://admin.microsoft.com
- Expand Users >> Active Users
- Use the Search and the user. Click on the user from the results grid, which opens user properties.
- On the user properties page, under “Roles”, You’ll find “SharePoint Administrator”
While these steps are quite simple, it would be cumbersome to go to each user’s properties and check if he/she has SharePoint Administrator role, isn’t it?
PowerShell to Get a List of SharePoint Online Administrators
This PowerShell script lists all SharePoint Administrators from Office 365 tenant. Use Azure AD PowerShell module to execute this script.
#Connect to Azure AD Connect-MSOLService #Get SharePoint Online Administrators Role $RoleID = (Get-MsolRole -RoleName "SharePoint Service Administrator").ObjectID #Get All Users with SharePoint Admin Role Get-MsolRoleMember -RoleObjectId $RoleID | Format-table -AutoSize
This prompts for login and gets you all SharePoint Administrators of the tenant.