On Jan 2, 2014, at 11:29 AM, Emmett Gray <[log in to unmask]> wrote:

I wanted to pass along some hard-earned knowledge. I am using AppleScript to shut down a machine running Mountain Lion on the local network. After numerous attempts, what I found works is to use a local application on that machine, launched by the Finder via eppc://, with (after some cleanup), tell application "System Events" to shut down. Very well so far. It shuts down. But, guess what? Because of Mountain Lion's "resume" flakiness (it's flaky because this does not happen 100% of the time), when I reboot that machine it immediately shuts itself off again because it resumes the shutdown app! My workaround is to have the shutdown app instead tell AppleScript Runner to do a script with that line to tell application "System Events" to shut down. Ha.

greetings,
depending on where you initiate the command, this would work also;

tell application "terminal"
 do script " ssh admin@server ' shutdown now ' " in front window
end tell

-j