- If your tenant users are synchronized from on-premises Active Directory, use
net localgroup administrators /add "Contoso\username"
. - If your tenant users are created in Azure AD, use
net localgroup administrators /add "AzureAD\UserUpn"
Reference:
https://docs.microsoft.com/en-us/azure/active-directory/devices/assign-local-admin