Posted on 07-09-2023 05:29 AM
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
07-09-2023 07:07 PM - edited 07-09-2023 07:09 PM
@mikaba You've got a few options:
Posted on 07-10-2023 05:55 AM
It's a lot of work and a bit like playing wack-a-mole but you can automate the updates using autopkg and munki if you don't have access to Jamf app installers. Then admin rights are not needed for so updates at least.