Skip to main content
Question

Unable to use the unix command in ARD to log in as one user on multiple computers running Mojave

  • February 22, 2019
  • 10 replies
  • 38 views

Forum|alt.badge.img+1

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)

10 replies

Forum|alt.badge.img+15
  • Valued Contributor
  • 301 replies
  • February 22, 2019

The Mac receiving the commands probably needs a PPPC profile that whitelists osascript to control System Events via AppleEvents, and accessibility (for the keystroke).

https://www.jamf.com/jamf-nation/articles/553/preparing-your-organization-for-user-data-protections-on-macos-10-14


Forum|alt.badge.img+7
  • New Contributor
  • 65 replies
  • February 22, 2019

That might work, but I thought Mojave dropped support for running scripts like these at the login window.


Forum|alt.badge.img+8
  • Valued Contributor
  • 80 replies
  • June 25, 2019


I got this to work in Mojave by using a PPPC config profile for ARDAgent.


Forum|alt.badge.img+13
  • Contributor
  • 101 replies
  • July 7, 2020

Thanks @zinkotheclown you have no idea how much time you just saved me and my team!


rcole
Forum|alt.badge.img+7
  • New Contributor
  • 77 replies
  • August 11, 2021

Has anyone been able to get this to work during the log in screen in Big Sur?


Forum|alt.badge.img
  • New Contributor
  • 1 reply
  • August 24, 2021

Has anyone been able to get this to work during the log in screen in Big Sur?


+This! Any fix for Big Sur?


Forum|alt.badge.img+2
  • New Contributor
  • 14 replies
  • December 8, 2021

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 

 


rcole
Forum|alt.badge.img+7
  • New Contributor
  • 77 replies
  • September 28, 2022

Anyone able to get this to work using Monterey? If so, are you using a PPC?


Forum|alt.badge.img+8
  • Valued Contributor
  • 80 replies
  • September 28, 2022

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


FutureFacinLuke
Forum|alt.badge.img+8
  • Valued Contributor
  • 119 replies
  • October 11, 2023


I got this to work in Mojave by using a PPPC config profile for ARDAgent.


Thank you, this allowed sending Unix commands via ARD