Forum Discussion
200OK Solutions
Aug 03, 2017Copper Contributor
Office365 User profiles
Hey Guys, How can check who tenant admin is? I am trying to edit user profile using default form, Somehow it works for few and doesnot work for other users. What can be the reason behind this? ...
Aljohn Bonifacio
Aug 04, 2017Iron Contributor
You can also use this Powershell script to get the list of all Tenant Admins and its Role.
Get-MsolRole | %{$role = $_.name; Get-MsolRoleMember -RoleObjectId $_.objectid} | select @{Name="Role"; Expression = {$role}}, DisplayName, EmailAddress
TonyRedmond
Aug 04, 2017MVP
And if you use the Azure AD V2 module, the code is:
Get-AzureADDirectoryRole | %{$Role = $_.DisplayName; Get-AzureADDirectoryRoleMember -ObjectId $_.ObjectId} | Format-Table @{Name="Role"; Expression = {$Role}}, DisplayName, UserPrincipalName -AutoSize