Your VM would have to be Entra joined
Once you join it, follow https://learn.microsoft.com/en-us/entra/identity/devices/assign-local-admin
Manually elevate a user on a device
In addition to using the Microsoft Entra join process, you can also manually elevate a regular user to become a local administrator on one specific device. This step requires you to already be a member of the local administrators group.
Starting with the Windows 10 1709 release, you can perform this task from Settings -> Accounts -> Other users. Select Add a work or school user, enter the user's user principal name (UPN) under User account and select Administrator under Account type
Additionally, you can also add users using the command prompt:
- 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 Microsoft Entra ID, use
net localgroup administrators /add "AzureAD\UserUpn"
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin