Category filter
Script to Revoke/Give Admin rights to Standard User in Mac
Administrative privileges are necessary for making system-wide changes like adding/managing users, adding/deleting programs etc. Using the following scripts, you can revoke or grant admin rights to a user through Hexnode.
Revoking admin rights of an account
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/bin/sh USERNAME=$1 sudo dseditgroup -o edit -d "$USERNAME" -t user admin errcode=$? if [ "$errcode" -ne 0 ]; then echo "" echo "Failed” echo "" exit 1 fi echo "Admin rights revoked for user $USERNAME" |
Giving admin rights to a standard account
1 2 3 4 5 6 7 8 9 10 11 |
#!/bin/sh USERNAME=$1 /usr/sbin/dseditgroup -o edit -a "$USERNAME" -t user admin errcode=$? if [ "$errcode" -ne 0 ]; then echo "" echo "Failed with errorcode $errcode" echo "" exit 1 Fi |
Need more help?