Granting temporary admin rights on macOS with automatic reversionSolved

Participant
Discussion
2 weeks ago

Hello! I’m managing a fleet of macOS devices via Hexnode UEM. I need to temporarily grant admin rights to standard user accounts on these devices for a brief period to perform tasks that require admin access. Is there a way to achieve this through a script or configuration profile? Any assistance would be greatly appreciated.

Replies (1)

Marked SolutionPending Review
Hexnode Expert
2 weeks ago
Marked SolutionPending Review

Hi! You can easily grant temporary admin rights to the standard user accounts on your Macs using a custom script. Below is a script that will elevate the user to admin for the specified duration, then automatically revert them back to standard account after the set time. A restart isn’t required for the changes to be effective on the device.

Note: replace user_name with the actual username of the standard user and specify_the_time_in_minutes with the desired duration for which the user should have admin rights in minutes.

You can deploy this script to your Macs using Hexnode’s Execute Custom Script remote action. The output of the script will show the status of the changes as given in the image.

Script output showing status of the account change

Reach out to us if you encounter any errors.

Cheers,
Ben Clarke
Hexnode UEM

Save