Script using credentials fails via Self Service

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
03-19-2021
10:22 AM
- last edited on
03-04-2025
01:24 AM
by
kh-richa_mig
I have a script to uninstall Zscaler that I want to run before upgrading an OS. When I run the script locally or via any policy not triggered by Self Service, it works. Even if I have a Self Service policy call a separate policy via a custom trigger. The Self Service policy doesn't apply the password and the GUI for the app comes up asking for the password instead.
#!/bin/sh
zspword=`echo 'passwordgoeshere' | base64 --decode`
/bin/launchctl unload /Library/LaunchDaemons/com.zscaler*
echo $zspword | sudo -S /bin/sh /Applications/Zscaler/.Uninstaller.sh
PIDS=`ps cax | grep "Zscaler" | grep -o '^[ ]*[0-9]*'`
if [ -z "$PIDS" ]; then
echo "Process not running." 1>&2
else
kill -9 $PIDS
fi
exit 0
Labels:
- Labels:
-
Self Service
0 REPLIES 0
