How to Assign Global/Company Administrator Role to the AzureAD App
This section provides information about how to assign Global/Company Administrator role to the AzureAD app using the PowerShell cmdlets.
Follow these steps:
- To install the MSOnline module, run the following command from the PowerShell Window using the Run as administrator option:
- Install-Module MSOnline
- To initiate a connection with Azure Active Directory (AzureAD), run the following command:
- Connect-MSolService
- Get the App id using the following command:
- $sp = Get-MsolServicePrincipal -AppPrincipalID <APP ID GUID>
- Note: APP ID GUID is the application id of the UDP application.
- Get the Global/Company Administrator role using the following command:
- $role = Get-MsolRole -RoleName “Company Administrator”
- To add the Global/Company Administrator role to the AzureAD app, use the following command:
- Add-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $Sp.ObjectId
The Global/Company Administrator role is assigned to the AzureAD app.