Temporary admin rights

YannickFlor
New Contributor

Hello,

in my company we would like to have the possibility to give users temporary admin rights on their Macs, for this I have already found this script : https://github.com/jamf/MakeMeAnAdmin

but unfortunately the currently logged in user is not promoted to admin and i can't find the error or what it could be.

Can this be due to Big Sur? we are also using mobile accounts, if this is important.

I'm still new to policies in connection with scripts,Jamf was practically inherited to me. I would be incredibly happy about any help.

Thanks in advance! :)

4 REPLIES 4

MatG
Contributor III

Have a look at the Privileges app
https://github.com/SAP/macOS-enterprise-privileges

junjishimazaki
Valued Contributor

This is my script to promote a user as admin:

!/bin/sh

-o: specify the operation. In this case, it is edit.

-a: add a user or group to the target group. In this case, it will be the currently logged in user.

-t: specify the type of resource that you are adding to the group.

dseditgroup -o edit -a "$(who | awk '/console/{ print $1 }')" -t user admin

exit 0

junjishimazaki
Valued Contributor

To remove a user as admin you have to remove that user from the admin group. sudo dseditgroup -o edit -d UserName -t user admin

junjishimazaki
Valued Contributor

If you did deploy that script you found as a policy, what do the policy logs show if there were any errors?