Hi anonymous user
First, log in to the Azure CLI using the global administrator. Note that you must log in with a global administrator, as only a global administrator can grant administrator roles for users.
az login
Next, use the Graph api to grant a tenant-wide global administrator role for your users.
$Body="{'principalId':'{user object id}', 'roleDefinitionId': '62e90394-69f5-4237-9190-012177145e10', 'directoryScopeId': '/'}"
az rest --method POST --uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments --headers "Content-Type=application/json" --body $Body
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.