Skip to main content
Question

Temporary admin rights

  • May 5, 2021
  • 4 replies
  • 33 views

Forum|alt.badge.img+1

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

Forum|alt.badge.img+10
  • Valued Contributor
  • May 5, 2021

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


junjishimazaki
Forum|alt.badge.img+10

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
Forum|alt.badge.img+10

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
Forum|alt.badge.img+10

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