#102495 - 2003-07-01 03:18 PM
Remote poweroff
|
Olan Wilson
Lurker
Registered: 2003-07-01
Posts: 3
|
Anyone know of a way to reomtely poweroff a machine? Assume Windows 2000 SP2 for the client O/S. I know of various ways to log off and shutdown a remote machine, but I can't find anything on actually powering off a remote machine.
Thanks.
|
|
Top
|
|
|
|
#102496 - 2003-07-01 03:21 PM
Re: Remote poweroff
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
if the OS/BIOS doesn't support soft poweroff, then you can't.
meaning, if you can sit at the PC and click, Start, shutdown, shutdown and it powers off, then you can do it remotely
if not, you can't
|
|
Top
|
|
|
|
#102497 - 2003-07-01 03:41 PM
Re: Remote poweroff
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Give this a go...
code:
Break On $sComputer = "remote_pc" $lLogoff = 0 $lShutdown = 1 $lReboot = 2 $lForce = 4 $lPoweroff = 8 $colOperatingSystems = GetObject("winmgmts:{(Shutdown)}!\\" + $sComputer + "\root\cimv2").ExecQuery("Select * from Win32_OperatingSystem") @ERROR ? For Each $objOperatingSystem in $colOperatingSystems $nul=$objOperatingSystem.Win32Shutdown($lPoweroff) @ERROR ? Next
[ 01. July 2003, 15:42: Message edited by: Chris S. ]
|
|
Top
|
|
|
|
#102499 - 2003-07-01 03:57 PM
Re: Remote poweroff
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Additionally, here are some more -
Shutdown/Restart - options
BTW, have you had a chance to look at the - KiXtart FAQ & How to's Forum?
Thanks,
Kent
|
|
Top
|
|
|
|
#102500 - 2003-07-01 04:51 PM
Re: Remote poweroff
|
Olan Wilson
Lurker
Registered: 2003-07-01
Posts: 3
|
Yes, I can sit at the machine and click Start -> Shut Down.. -> Shut down and the PCs will poweroff, but I have not been able to power off remotely. Using shutdown.exe from the resource kit, the rundll.exe trick, and even the shutdown KiX function all result in a shutdown with the "It is now safe to turn off your computer" screen. Nothing I have found yet will actually power off the workstations.
Thanks for the help, I will try the suggestion from Chris S.
|
|
Top
|
|
|
|
#102501 - 2003-07-01 06:01 PM
Re: Remote poweroff
|
Olan Wilson
Lurker
Registered: 2003-07-01
Posts: 3
|
Chris S.'s suggestion worked great. Thanks!!
|
|
Top
|
|
|
|
#102503 - 2003-07-18 08:43 PM
Re: Remote poweroff
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
for some reason, this will shutdown remote PCs, but when I try to LOGOFF remote machines, the local machine logs off
code:
Function RemoteLRS($computer,$x) dim $oWBEM, $oShutdown, $oOpSys ; 0 - LogOff 4 - Force LogOff ; 2 - Reboot 6 - Force Reboot ; 8 - Shutdown 12 - Force Shutdown $oWBEM = GetObject('winmgmts:{(Shutdown)}!\\$computer\root\CIMV2') $oShutdown = $oWBEM.ExecQuery('Select * from Win32_OperatingSystem where Primary=true') if $oShutdown.count For Each $oOpSys in $oShutdown $RemoteLRS=$oOpSys.Win32Shutdown($x) Next endif $oShutdown=0 $oWBEM=0 endfunction
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|