Posted on 02-22-2019 08:25 AM
I normally run this script when trying to log into multiple computers via Apple Remote Desktop:
osascript -e 'tell application "System Events"' -e 'keystroke "username"' -e 'keystroke tab'
-e 'delay 0.5' -e 'keystroke "password"' -e 'delay 0.5' -e 'keystroke return' -e 'keystroke return' -e 'keystroke return' -e 'keystroke return' -e 'end tell'
When I try to run this script on computers running Mojave I get the error:
execution error: System Events got an error: osascript is not allowed to send keystrokes. (1002)
Posted on 02-22-2019 08:30 AM
The Mac receiving the commands probably needs a PPPC profile that whitelists osascript
to control System Events via AppleEvents, and accessibility (for the keystroke).
Posted on 02-22-2019 01:28 PM
That might work, but I thought Mojave dropped support for running scripts like these at the login window.
Posted on 06-25-2019 02:08 PM
I got this to work in Mojave by using a PPPC config profile for ARDAgent.
Posted on 10-11-2023 08:41 AM
Thank you, this allowed sending Unix commands via ARD
Posted on 07-07-2020 12:23 PM
Thanks @zinkotheclown you have no idea how much time you just saved me and my team!
08-10-2021 05:01 PM - edited 08-10-2021 05:01 PM
Has anyone been able to get this to work during the log in screen in Big Sur?
Posted on 08-24-2021 12:08 PM
+This! Any fix for Big Sur?
Posted on 12-08-2021 03:24 PM
Yes I manage to get it working by doing the following
1. If you have a Restrictions Config Profile make sure Allow AirPlay, View Screen by Classroom, and Screen Sharing (macOS 10.14.4 or later, enrolled via a PreStage enrolment) is checked under the Functionality tab.
2. Create a PPPC
ARD Agent can be found in /System/Library/CoreServices/RemoteManagement/ARDAgent.app >Allow System Events and Accessibility
Script Editor > Allow Accessibility
Posted on 09-27-2022 06:26 PM
Anyone able to get this to work using Monterey? If so, are you using a PPC?
Posted on 09-28-2022 08:57 AM
The PPPC profile no longer works on newer macOS's starting with Catalina. You have to enable RDC with a management command in Jamf.
https://community.jamf.com/t5/jamf-pro/enabling-remote-desktop-on-catalina/m-p/224293