ducksrfr / mac_admin

Helpful scripts & configuration profiles for the Mac admin community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Execution error: No User interaction allowed.

Genesis2kx opened this issue · comments

When testing from a Jamf Pro Policy I get the following error in the policy logs.

28:320: execution error: No user interaction allowed. (-1713).

Seems to work fine when I run the script locally from terminal. The only difference is it's running as root from JAMF and not root when local.

Any ideas?

Yes, the mac in on Mojave and the error is only seen in the policy log in the Jamf Pro server when the policy runs. On the mac itself, no pop-ups appeared with the dialog stating the password was expired etc. and didn't open the system preferences window. It's as if the script could not execute at all on the machine. Tried another mojave machine and same error in the policy log, but no signs that the script ran at all on the target machine since no pop-ups appeared.

I uploaded the jamf accessibility config profile and got an error that it could not create an object from the file. Does the file need to be edited in some way before upload? @ducksrfr

Ok, if the dialog won't even appear let's make sure you have Jamf whitelisted for System Events, SystemUIServer, and Finder as well. Here's an example profile: https://github.com/rtrouton/privacy_preferences_control_profiles/tree/master/Privacy%20Settings%20Whitelist%20-%20Jamf%20Notifications

I would also try signing the profiles before uploading to Jamf so that it doesn't get altered in any way.

Ok, the script has been updated to reflect what I have in Jamf. sudo -u $currentUser is prepended on each osascript command. Added an additional note about PPPC whitelisting for AppleEvents to control System Events along with PPPC whitelisting for Accessibility.

Prefacing osascript command with sudo -u $currentUser resolves issue when running script via Jamf/as root.