Using the PowerShell Interface
This section provides information about how to assign the Global Admin role to Azure application using the PowerShell interface.
- To assign the role automatically, follow these steps:
- Download the PowerShell script. To download, click AssignGlobalAdminRoleToADApplication.ps1.
- Open the PowerShell window using the Run as Administrator option, navigate to the downloaded script path, and then run the following command:
- .\AssignGlobalAdminRoleToADApplication.ps1 <Application(client) id generated from the Azure portal>
- .\AssignGlobalAdminRoleToADApplication.ps1 60f92079-d1bf-40f7-9ab5-59caab8e7534
- To assign the role manually 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
- To get the App ID, run the following command:
- $sp = Get-MsolServicePrincipal -AppPrincipalID <APP ID GUID>
- Note: APP ID GUID is the application ID of the UDP application.
- To get the Global/Company Administrator role, run the following command:
- $role = Get-MsolRole -RoleName 'Company Administrator'
- To add the Global/Company Administrator role to the AzureAD app, run the following command:
- Add-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $Sp.ObjectId
Example: