Posted on 05-29-2020 11:36 AM
Attempted the displayMessage.sh provided by Jamf.
Very inconsistent between OS versions but the policy comes back with:
Script result: Displaying message to user...
36:341: execution error: An error of type -10810 has occurred. (-10810)
It exits successfully on some systems - they don't see the message
The rest fail with that error ..
I can't determine why ... any input appreciated
Posted on 06-03-2020 06:17 AM
Does the 36:341 indicate that's a location within the script?
Posted on 08-27-2020 02:52 PM
We're having this same issue with the same script - any help would be appreciated! Seems to work some of the time for some machines and fail for others.
1 test machine failed at first, we flushed the policy, and then it completed the second time. Could not determine the circumstances that made a difference in completion.
Posted on 08-27-2020 03:38 PM
That error looks to be an error with Apple Script. After looking at the script its probably to do with this line:
osascript -e 'tell application "System Events" to display dialog "'"$message" -e '"buttons {"OK"} default button 1';;
if thats the case I believe 1) Jamf or this script has to be approved to run osascripts, and 2) the osascript part needs to be run as the user. try sudo -u <username> osascript -e .......
Thats my 2 cents ;P
Shawn
Posted on 08-31-2020 12:59 AM
There are two thing might be the issue here. The first is that you may be running into privacy (PPPC) blocking your script from sending an event to "System Events." The good news here is that you don't need the tell app "System Events"
in this case:
osascript -e 'display dialog "'"$message" -e '"buttons {"OK"} default button 1'
Will work just fine, without triggering PPPC dialogs.
The second is that osascript
command should run as the current user. Anything that interacts with user interface or user processes should run as the current user and not as root. However, scripts run from Jamf Policies will run as root. I describe a solution for this here: Running a Command as another User – Scripting OS X