How to restrict the login to dedicated users with intune – Part 1

How to Restrict the Login to Dedicated Users with Intune – Part 1

In the Active directory it was possible to allow a user to log in only to certain computers. This is no longer so easy with Microsoft Entra ID and Intune. In this blog we would like to look at how you can realize this with the help of a custom profile.

Creating the Custom Profile for the login restriction

  • Open the Intune admin center
  • Navigate to Devices -> Configuration Profile
  • Click + Create profile
  • Select Windows 10 and later as Platform
  • Select Template -> Custom as Profile type
  • Click Create
How to restrict the login to dedicated users with intune – Part 1
  • Enter a Name and click Next
How to restrict the login to dedicated users with intune – Part 1
  • Click Add
  • Enter the following information:
  • Name: LocalLoginRestriction
  • OMA-URI: ./Device/Vendor/MSFT/Policy/Config/UserRights/AllowLocalLogOn
  • Data Type: String
  • Value:

As Value you have to specify the account you want to use. It is also possible to specify multiple accounts, but you must use the following tag to separate them:

& #xF000;    (Without Space between & and #)

But you can’t use the tag just like that. This must be converted via an XML decoder. There are tools for this on the internet or you can copy the ascii key from her:

Here are a few examples that you can specify as value:

Allow login only for local accounts:

<![CDATA[*S-1-5-113]]>

All users who have already logged on locally:

<![CDATA[*S-1-2-0]]>

Add the Administrators group and a Microsoft Entra ID user

AdministratorsAzureAD\user@tenant.com
  • Click Save
  • Click Next
How to restrict the login to dedicated users with intune – Part 1
  • Assign the Policy to a group
  • Click Next
  • Click Next
  • Click Create
How to restrict the login to dedicated users with intune – Part 1

So now let’s test this out. I am trying to log in with a user that is not allowed.

This is how the screen looks like when a user tries to log in who is not in the list.

How to restrict the login to dedicated users with intune – Part 1

Conclusion

Restricting the login may be required for special use cases. Unfortunately, this is currently only possible with local and Microsoft Entra ID users or local groups. Central management via a Microsoft Entra ID group is not currently possible. A separate blog post covers a possible workaround

Stay healthy, Cheers
Jannik

7 thoughts on “How to Restrict the Login to Dedicated Users with Intune – Part 1

  1. Hi, is it possible to add an Azure AD group, rather than a username? Thanks!

  2. Hi.
    We tried this, using AdministratorsAzureAD\person@domain.com. This denied everyone from logging on, includnig any admins and the user listed. This persists even after deleting the configuration policy. Do you know a fix for this?
    Thanks

    • Hey Anders, yes this is an issue of this configuration profile. You can remove this via a Account protection policy. Here you cen specify delete group.

Comments are closed.