Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mass login via ARD (need current UNIX script)

I need to mass log in to multiple lab computers to do individual work with them at the Desktop using ARD 3.7.1. Old UNIX scripts posted elsewhere on the forum no longer work with more recent versions OSX (I am running 10.8.5). I get a "Succeded" when nothing actually happened (the computer remains at the login screen). In the past I would be taken to the desktop after running the script.


For example:


osascript <<EOF

tell application "System Events"

keystroke "<username>"

keystroke tab

delay 0.5

keystroke "<password>"

delay 0.5

keystroke return

keystroke return

end tell

EOF

iMac, OS X Mountain Lion (10.8.5)

Posted on Jan 14, 2014 1:50 PM

Reply
12 replies

Jan 14, 2014 3:13 PM in response to plugsandpixels

your actual issue might be related to previous complaints that in mavericks, the cursor is not reliably in the "name" field on logout or coming out of sleep. Not really sure of all the criteria. Am pretty sure that on initial start up it is in the name field. Which may mean that is why the script worked on restart.


I have been using that script with mavericks and it works fine -- IF the cursor is in the name field. Which is always the way it has been. Also, it has always been you will get a "succeeded" even if it was not in the name field and thus not logged in.

Mar 7, 2014 7:52 AM in response to plugsandpixels

Was also having this problem and forgot about it because I haven't used it and some people on Macenterprise forums posted the fixes, the top two lines are added for the problematic OS's like Mt Lion, etc.


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

osascript -e 'tell application "Bluetooth Setup Assistant" to quit'; \

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

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

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

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

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

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

Mar 19, 2014 11:40 AM in response to Daniel Ball

Oh, I have no doubt or complaints about suggested log in scripts working in 10.8.x.


Or 10.7.x.


Or 10.6.x.


Or 10.5.x.


Or even 10.4.x (although I think some of them have evolved since then). We've been using them for over 10 years to do all sorts of cool, easy, awesome lab maintenance/deployment.


But they DON'T WORK IN 10.9 ON MY 100 MACHINES.


I'm happy that people have solutions for their labs running 10.not9. If I could, I'd switch my labs back to pre-10.9 days and be happy as a clam. But I can't.

Mar 22, 2014 10:53 AM in response to Daniel Ball

I did the first thing - just sent the security agent line to 10.9.2 clients from 10.9.2 computer running 3.7.2 admin and worked exactly as expected - made the cursor appear in the Name box. Then I ran the script I have always used to login and it worked as expected.


Then I adapted the line into my script (which is in a little different format) and that worked fine also. So could go from a client with no cursor showing to logged in with one unix command using 3.7.2 to a 10.9.2 client.

Dec 17, 2015 12:29 PM in response to Daniel Ball

So, I had problems in my 10.9.5 lab with both scripts. After a little tinkering with the second posted script I came up with the following which works for me:


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

osascript -e 'tell application "Bluetooth Setup Assistant" to quit'; \

osascript -e 'tell application "System Events" to keystroke "<username>"'; \

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

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

osascript -e 'tell application "System Events" to keystroke "<userpassword>"'; \

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

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


I'm not a scripter so not sure why this works and not the original. I kept getting an error about the 'tab' part I think so I got rid of that. I thought my lab might be slower so I added more delay. Anyway, hope it helps those for whom the other ones don't.

Mass login via ARD (need current UNIX script)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.