How do I add users synced from AD to AAD as local administrators on Windows 10 devices with OMA-URI?

Copper Contributor



I am trying to create a custom policy to add users as local admin on devices with the OMA-URI "./Device/Vendor/MSFT/Policy/Config/RestrictedGroups/ConfigureGroupMembership".


This works fine when I specify Azure user accounts (accounts created in AAD, not synced from local AD). However, when I try to add users synced from AD to the policy it fails and does not add the user to local admin group on my Windows 10 computer.


Has anyone managed to do this?

The syntax I use is as follows:


<accessgroup desc = "Administrators">
<member name = "Administrator" />
<member name = "AzureAD\"/>
<member name = "AzureAD\"/>


Test.user is a cloud only user, while test.user2 is synced from local AD. Test.user gets added to the local admin group just fine, but test.user2 is not added.

1 Reply

Anything in event log on the client, DeviceManagement-Enterprise-Diagnostics-Provider ?

Your syntax looks ok and as you are saying, it works for cloud only.

If they should be added to all devices, have you tried adding them with "Additional local administrators on Azure AD joined devices" that you find under Device -> Device Settings in Azure AD?

Global admins and device owner gets local admin rights by default.

Another options is by PowerShell - “net localgroup administrators AzureAD\ /add > nul 2> nul” | cmd