Remote shutdown ("unattended")

L

Lynx

Hi Guys,
When remotly shutting down computer using
shutdown -s -f -m \\someName
the remote one will come up with a message "....it is safe to switch...."
At the same time the normal shutdown would turn power off
And that is what I am trying to achieve
Is it any way to perform "unattended mode" of remote shutdown?
(the remote comuter is win2000 Pro SP4)
Thanks in advance
 
S

Sparda

Hi Guys,
When remotly shutting down computer using
shutdown -s -f -m \someName
the remote one will come up with a message "....it is safe to
switch...."
At the same time the normal shutdown would turn power off
And that is what I am trying to achieve
Is it any way to perform "unattended mode" of remote shutdown?
(the remote comuter is win2000 Pro SP4)
Thanks in advance

Dose the remote computer actualy support auto power off?
 
G

Guest

Cut n past this into notepad and save with the extension ".vbs".

strComputer = "atl-dc-01"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Shutdown(1)
Next

Replace strComputer with "." to reboot the machine on which you're running
the script, or the name/ip of the remote computer you want to shutdown.

This method works well for 2000/xp TS or not. Make sure you've got admin
rights on the target machine.

Jeff Nall
 
L

Lynx

Thanks Jeff.
I tried it and the error msg I'm getting is
(2, 1) Microsoft VBScript runtime error: The remote server machine does not
exist or is unavailable: 'GetObject'
I didn't mentioned that command/script executed from XP Pro SP2
in order to shutdown W2000
Thanks again
 
J

Jeffrey Randow (MVP)

Also, try running shutdown -i ... With that tool, you can configure
this in a friendly GUI...
 
L

Lynx

Thanks Jeffrey

for pointing out [- i] parameter which is conveniently hushed up in MS Help
& Support description. Possibly this way they encourage users to issue /?
first :)

Anyway the result is the same: succeeded but needs to be attended for
power-off-push-button-safe-action

Unfortunately there is no option in displayed dialogue similar to

/POWEROFF as in tsshutdn command

.. a bit frustrating. It should be the way remembering the fact that normal
shutdown powers off the box

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top