Hello,
I write at once what purpose I pursue. The computer is issued to a user with administrator rights, Autopilot is used. But it is necessary that no one except this user and the administrator be a local administrator, and this user is also not an administrator on other devices.
There are several ways that might work.
First way:
- In the autopilot policy, allow all users logged in to be administrators by default.
- Create a local group "Device Owners" using the Intune Configuration profile.
- Create a script that will be executed on the computer, which will somehow be able to find out who the Primary user is on this device and add its ID to the local group ("Device Owners").
I don`t know how can I get Primary user on Device side, without access to Azure AD.
I can of course calculate by the date the profile was created. If the device is explicitly assigned to the user with autopilot, then he is the first who will enter the system. If he logs in first, I can find out who it is by analize when profile was created wih the same script. But I think it's very difficult.
- Create a profile that allows local login and remote connection via RDP only for members of the "Device Owners" group
https://jannikreinhard.com/2021/09/24/how-to-restrict-the-login-to-dedicated-users-with-intune/
- I can also additionally use Account protection, which will exclude all users from the local administrators group, except for "Device Owners".
Second way:
- Make all users default in the Autopilot policy.
- Use LAPS to reset the local administrator password and pass the password to the user if he needs privilege escalation
- Use Account protection policy to kick out non-administrators if a user is created and add such a user
Third way:
- Using Endpoint Privilege Management
How else can this be implemented?
In fact, only the Primary user should be a local administrator, but there are many devices and for each to make an Account protection policy or local login settings, it's too complicated. There will be many policies, this is not the best option.
Option 1 and 2 look the same ugly.
Thank you.