imissapplecomputer

Q: Mac labs:  ARD login script not working in 10.11

I run the computer science labs at a state university.  5 labs w/100+ machines.  We've been an all Mac shop since the switch to Intel chips.

 

I've been using the following login script for years:

 

name="user";

password="pword";

 

osascript <<EOF

tell application "System Events"

    keystroke tab

    keystroke (ASCII character 8)

    keystroke tab

    keystroke (ASCII character 8)

    keystroke return

    delay 0.5

    keystroke tab

    keystroke "$name"

    keystroke tab

    delay 0.5

    keystroke "$password"

    delay 0.5

    keystroke return

    keystroke return

end tell

EOF

 

When I send it to a 10.11 machine (with and without SIP), I get the following message in the Task Status field:

 

osascript[261:2199] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data

 

I don't know if the problem lies with ARD admin being 3.8 and the 10.11 client being 3.8.5.  I had similar problems with admin/client disparity some time ago that went away when ARD admin was updated.

 

Not being able to login to my 100+machines is a deal breaker.  I cannot deploy 10.11 nor can I recommend that we purchase new machines this year (we typically replace 1/3 every year).

 

Anyone have a script that works in 10.11?

iMac, OS X El Capitan (10.11.2)

Posted on Dec 17, 2015 5:48 AM

Close

Q: Mac labs:  ARD login script not working in 10.11

  • All replies
  • Helpful answers

  • by Rasim Cakir,

    Rasim Cakir Rasim Cakir Jun 5, 2016 10:43 PM in response to imissapplecomputer
    Level 1 (9 points)
    Jun 5, 2016 10:43 PM in response to imissapplecomputer

    Hi, did you solve this problem already? I would be interested in the solution since I have the same issue with my El Cap clients ...

    Thank you in advance for your help.

  • by WarhavenLA,

    WarhavenLA WarhavenLA Jun 20, 2016 2:59 PM in response to imissapplecomputer
    Level 1 (4 points)
    Servers Enterprise
    Jun 20, 2016 2:59 PM in response to imissapplecomputer

    Problem is still present.  I filed a bug report with Apple, but this issue seems to be an AppleScript problem in general.  I'm getting this erroneous error when running scripts locally as well.

  • by Pagrash,

    Pagrash Pagrash Jun 21, 2016 3:22 PM in response to WarhavenLA
    Level 1 (79 points)
    Servers Enterprise
    Jun 21, 2016 3:22 PM in response to WarhavenLA

    Mine also failed (same script).

    My guess is it might be SIP which also caused me certain other configuration problems.

  • by TeenTitan,

    TeenTitan TeenTitan Jun 25, 2016 11:15 PM in response to imissapplecomputer
    Level 4 (2,454 points)
    Jun 25, 2016 11:15 PM in response to imissapplecomputer

    have you tried

     

    send command as: root

    with command:

    osascript -e 'tell application "SecurityAgent" to activate'; \

    osascript -e 'tell application "System Events" to keystroke "test"'; \

    osascript -e 'tell application "System Events" to keystroke tab'; \

    osascript -e 'tell application "System Events" to keystroke "test2"'; \

    osascript -e 'tell application "System Events" to delay 0.5'; \

    osascript -e 'tell application "System Events" to keystroke return'


    If that does not work, for the account your using to remote into the computer.

    Log into the client. User Directory Utility to enable root

    login to the computer as root

    open system preferences Security & Privacy

    click on privacy tab

    click on accessablity

    check SystemUIServer


    Then try re-sending the command.