List and Export the Admin Roles Assigned to Users in Office 365 with PowerShell

If you didn’t know, you can use the Office 365 Admin portal to view and create views of all the admin roles in Office 365 and who is assigned to each of those roles. This is good for a quick reference, but sometimes we need that data in a workable format (CSV). The following step-by-step will show you how to list and export the admin roles assigned to users in Office 365 with PowerShell. This is done with the Get-MsolRoleMember command in PowerShell

 

Connect to Azure Active Directory with PowerShell

Enter the command $role = Get-MsolRole -RoleName “Company Administrator”

Enter the command Get-MsolRoleMember -RoleObjectId $role.ObjectId | Export-CSV c:\directory\filename.csv

This will export all the members of the Company Administrator (Global Admin) group.

 

If you want to export from the other built-in groups, a list is provided below. You can always view the roles by entering the command Get-MsolRole

 

Name Description
Compliance Administrator Compliance administrator.
Exchange Service Administrator Exchange Service Administrator.
Partner Tier1 Support Allows ability to perform tier1 support tasks.
Company Administrator Company Administrator role has full access to perform any operation in the company scope.
Helpdesk Administrator Helpdesk Administrator has access to perform common helpdesk related tasks.
Lync Service Administrator Lync Service Administrator.
Directory Readers Allows access to various read only tasks in the directory.
Directory Writers Allows access read tasks and a subset of write tasks in the directory.
Device Join Device Join
Device Administrators Device Administrators
Billing Administrator Billing Administrator has access to perform common billing related tasks.
Workplace Device Join Workplace Device Join
Directory Synchronization Accounts Directory Synchronization Accounts
Device Users Device Users
Partner Tier2 Support Allows ability to perform tier2 support tasks.
Service Support Administrator Service Support Administrator has access to perform common support tasks.
SharePoint Service Administrator SharePoint Service Administrator.
User Account Administrator User Account Administrator has access to perform common user management related tasks.

 

Thanks for visiting and reading my posts. I am always looking for more ideas. Please comment or email me with what you would like to see.

Kelsey Epps Office365 MVP

Email Me Follow me on Twitter Connect with me on LinkedIN

3 thoughts on “List and Export the Admin Roles Assigned to Users in Office 365 with PowerShell

    1. Kelsey EppsKelsey Epps Post author

      Sorry for the late reply. I am unsure how to do this based on the tenant id. If I get some time, I will figure it out.

      Reply
  1. Pingback: Office 365 and PowerShell [Azure, Exchange, & Active Directory] | DANIEL M. CREANEY

Leave a Reply