Monitoring Local Admins on Endpoints

PowershellRMM

The problem and thought behind it

We are currently looking at ways to keep a tighter hold over client workstations and the administrative rights a user has over it. One thing we are starting with is who is an administrator on a machine.

When a person owns their PC, they are the sole administrator so can do whatever they want as it is theirs to do with. In the corporate environment, people expect to have administrative control on devices, even though it’s not necessary for their role. A user may have been given admin privileges over their corporate computer by the internal IT as a quick fix to an issue, as they are a VIP user in the company or maybe it was meant to be removed by never did.

It maybe that the company wants managers to have administrative control over their team’s workstations for simple tasks (software install, driver updates ect). This is a problem that is seen a lot when internal administrators make changes to a device to quickly solve an issue, but not the long term fix.

These rights are handed out gradually as they are wanted and with very little thought on the security implications or reporting.

This is being reduced with technology like PIM or LAPS but unfortunately, users still want to have rights they don’t need – frustrating every MSP technician!

The concept and the outcome

I have created created a RMM component to run a script, to control this. The job takes note of all users under the local administrator group and write the output to a UDF under the target device in RMM. The output is a list of users that have administrative rights over the workstation.

This process will then give the client visibility of devices and the administrators, which can then be adjusted if it’s not needed.

Local administrators need to be controlled because if an end user account gets breached and the account has administrator privileges over other devices, it will significantly easier access, adjust and impact the workstation. It may also be that the end user begin to use the workstation for personal uses and want to install software that’s not controlled by an MDMs such as Intune.

This only gives a list of who currently has access to the device and audits the output.

The purpose of the MSP is to support the end user and not to make assumptions and changes to devices, without consulting, agreeing and planning with the approved technical contacts. When changes are made with the best intentions, the end user can see it as the IT getting too involved and disruptive. The script created only gives a list, which the account manager can pass to the user and have them made the choice.

How it works

The first step of the process, the script needs the machine name, users that you want excluded such as your approved administrator account, and the members of the administrators group. The below example is adding the domain account tomw.admin along with the two local administrator accounts to excludedUsers variable.

This is a adjustable list that can be changed as the client requires it.

The next step filters out the Windows built in users or orphaned accounts that start with S-1-12-1- and the users listed in the excludedUsers variable listed above. This means that only active users are listed.

Now that the information has been gathered and formatted correctly, the file step is to get the info and add it to a variable on the device, using RMM. This then writes it onto the RMM portal against the machine.

How it looks

The process presents a simple list of all users in the local administrators group, that can then be presented to the client and for them to decide on. Obviously, the account manager will express the concerns and dangers but at the end of the day, it’s up to the end user.

Conclusion

This component gives the RMM users an over view of who’s got local administrator rights on a machine. Controlling these rights whilst not impacting at a company level, it takes one machine to get breached and the attackers are in. Keeping these rights under lockdown reduces the blast radius and other devices that they could impact.

There’s also a simple Powershell script that can be ran to list the end users that aren’t wanted, loop through the machine and remove them from the local administrators.

This could be built into RMM and used on an ad-hoc basis, as the requirements of the business changes.

Leave a Reply

Your email address will not be published. Required fields are marked *