Hey,
I have a script that removes local admins from Mac, without the need to restart the Mac and it works great. I would like to solve the issue of updating existing apps without the need for admin privileges.
for example: if Slack pushes an important update, users need me immediately in order to access Slack.
Any ideas on how can I solve this issue? adding here the script I use:
#!/bin/sh
adminUsers=$(dscl . -read Groups/admin GroupMembership | cut -c 18-)
for user in $adminUsers
do
if [ "$user" != "root" ] && [ "$user" != "Administrator" ] && [ "$user" != "administrator" ] && [ "$user" != "jss_mgmt" ]
then
dseditgroup -o edit -d $user -t user admin
if [ $? = 0 ]; then
echo "Removed user $user from admin group";
pkill -U "$user" -9 -f "/Applications/*"
pkill -U "$user" -9 -f "/System/Library/*"
pkill -U "$user" -9 -f "/Library/*"
fi
else
echo "Admin user $user left alone"
fi
done