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)
The Mac receiving the commands probably needs a PPPC profile that whitelists osascript
to control System Events via AppleEvents, and accessibility (for the keystroke).
That might work, but I thought Mojave dropped support for running scripts like these at the login window.
I got this to work in Mojave by using a PPPC config profile for ARDAgent.
Thanks @zinkotheclown you have no idea how much time you just saved me and my team!
Has anyone been able to get this to work during the log in screen in Big Sur?
Has anyone been able to get this to work during the log in screen in Big Sur?
+This! Any fix for Big Sur?
Has anyone been able to get this to work during the log in screen in Big Sur?
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
Anyone able to get this to work using Monterey? If so, are you using a PPC?
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
I got this to work in Mojave by using a PPPC config profile for ARDAgent.
Thank you, this allowed sending Unix commands via ARD
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.