Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Script the Login window through Apple Remote Desktop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script the Login window through Apple Remote Desktop
Authored by: ecwh73 on Sep 06, '11 10:31:46AM

John,

What technique did you use to determine the field names in SecurityAgent? 10.7 has completely broken this functionality and I'm rather hurting here to fix it. We manage around a 1000 macs, mostly during production hours. The original Apple ARD script still works, but it's rather clumsy pushing strings into System Events without field references.

Given the format is just "text field 1 of group 1 of window 1", was it just a lucky guess?

I have developed a rather trivial way to push out password hash updates if required, but I would rather not have to need to due to a field population error.



[ Reply to This | # ]
Script the Login window through Apple Remote Desktop
Authored by: applebit on Mar 20, '12 11:21:32AM
I have since discovered that 10.7 has broke this - an altered version worked for me this morning (even showing this to some of the other tech's in our office) then it broke - now if I run the same code by sending out via ARD it works... I submitted a bug report with Apple because we need this resolved!



sudo touch /var/db/.AccessibilityAPIEnabled
osascript <<EOT<br> tell application "System Events"
tell process "SecurityAgent"
set value of text field 1 of group 1 of window "Login" to "localpass"
set value of text field 2 of group 1 of window "Login" to "localadmin"
end tell
end tell
EOT


and the other option that WAS working but now isn't (and only a few short hours later!):


osascript <<EOT<br> tell application "System Events"
tell process "SecurityAgent"
repeat 2 times
delay 0.1
key code 48
delay 0.1
key code 51
end repeat
keystroke "username"
key code 48
keystroke "password"
repeat 3 times
delay 0.1
key code 36
end repeat
end tell
end tell
EOT


---
Jon McCullough
Systems Support Specialist


[ Reply to This | # ]
Script the Login window through Apple Remote Desktop
Authored by: applebit on Mar 20, '12 11:31:07AM
Just sent to Apple Bug Report:

ok, new info - if I send the command thru ARD it works and *THEN* it will work in the script - it appears as though "System Events" is not running until then. So either this was done by design or it is a bug. Either way it would be **GREATLY** helpful to know as this is a }}MAJOR{{ functionality of our environment and we are considering moving all 2000 intel machines to 10.7 in a few months.
---
Jon McCullough
Systems Support Specialist


[ Reply to This | # ]