Skip to content

Instantly share code, notes, and snippets.

@thierrybuisson
Last active July 8, 2020 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thierrybuisson/68ff8f9c8509ee4ea7e408a23d809bc2 to your computer and use it in GitHub Desktop.
Save thierrybuisson/68ff8f9c8509ee4ea7e408a23d809bc2 to your computer and use it in GitHub Desktop.
//Sharepoint Online - Site hub management
//Please connect first with - PS> Connect-SPOService -url https://<your tenant>-admin.sharepoint.com
#Export all admin users and roles to CSV
Get-MsolRole | %{$role = $_.name; Get-MsolRoleMember -RoleObjectId $_.objectid} | select @{Name="Role"; Expression = {$role}}, DisplayName, EmailAddress | Export-Csv .\tenantadminrole.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment