Adding Microsoft Account on Entra Joined Computer to Local Admin Groups

If you have a Microsoft account logged in to a Windows machine that’s also joined to Microsoft Azure/Entra, and you want to add that Microsoft Account to the local Administrators group on that computer, here’s how to do it:

Make sure you are logged in in to the Windows machine with the Microsoft account.
Run command line as Admin (you would need to know an admin credentials on the machine like a local admin).
Type:
WhoAmI

That should show you the full path of your account (something like AzureAD\SomeUsername)

In command like type the following:

net localgroup administrators AzureAD\SomeUsername /add