Restart unattended remote server from login window

I run FileMaker Server 8 Advanced on OS X Server 10.4 with Web Publishing Engine, SSL, iTools and Timbuktu. Another computer runs a FileMaker client that periodically checks the status of data on the server and kicks off a script or not, depending on what it finds. I’m trying to write a sscript that will re-start the server if the status check doesn’t execute properly - so the server will either report per the status check, or re-start if it doesn’t report.

If I use Applescript to tell the Finder to re-start:
tell application “Finder” of machine “eppc://192.168.0.2”
restart
end tell
It re-starts, but with two problems:
It asks for a user name and password for authentication -this has to run unattended.
The machine won’t have the Finder loaded - it will be sitting there with the login window up.

The login window alows the user to re-start without authentication, so I tried:
tell application “System Events” of machine “eppc://192.168.0.2”
Result: Application isn’t running

So I tried it without reference to an application:
tell “System Events” of machine “eppc://192.168.0.2”
Result: Can’t get “System events” of machine “eppc://192.168.0.2”. Access not allowed.

I’ve also tried using osascript, but I can’t work out how to combine that with eppc.

I would be delighted if anyone could give me some help on how to re-start a remote machine from the login window and with any authorisation necessary in the script.

Colin

http://www.macosxhints.com/article.php?story=2005062918513721

Thanks for the reply.

I modified the script you suggested to:

property IPADDR : “192.168.0.2”
property USERNAME : “user”
property passwd : “pswrd”

set tempip to “eppc://” & USERNAME & “:” & passwd & “@” & IPADDR
set remote_computer to application “System Events” of machine tempip
using terms from application “System Events”
tell remote_computer
restart
end tell
end using terms from

I expected this to work but it delivers: “Cannot find process on host”

“Restart” is in the dictionary for System Events. Anyone any idea where this is going wrong?

Colin

The like I sent was just to solve the “The machine won’t have the Finder loaded - it will be sitting there with the login window up.” issue.

I think that’s at the heart of the problem. It looks as if AppleScript has to have an app to talk to.

I’ve tried this using a shell script as well, but still no joy. Looks like I’ll have to buy a web controlled power switch.

Thanks for taking an interest.

Colin