Command line Shutdown for DC

  • Thread starter Francisco Casco
  • Start date
F

Francisco Casco

Hello i have a domain with 3 w2k servers and all connected tu a UPS that has
a serial cable tu the master browser of the domain (Trinity). I want to shut
down the other domain controllers (Neo) and (Smith) by a local process
activated by the ups service on Trinity. Is this possible, can i do it by a
command line or can i create a bat file to do the trick?
Thanks in advanced...


Francisco
 
D

Dave Patrick

Possibilities include;
shutdown.exe from the Windows 2000 resource kit.

psshutdown from sysinternals
http://www.sysinternals.com/ntw2k/freeware/psshutdown.shtml

VBScript
-------------------------------
'0 Log Off
'4 Forced Log Off
'1 Shutdown
'5 Forced Shutdown
'2 Reboot
'6 Forced Reboot
'8 Power Off
'12 Forced Power Off
Const SHUTDOWN = 1
strComputer = "."
Set objWMIService = GetObject("winmgmts: {(Shutdown)}" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(SHUTDOWN)
Next
-------------------------------

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]
http://www.microsoft.com/protect.

:
| Hello i have a domain with 3 w2k servers and all connected tu a UPS that
has
| a serial cable tu the master browser of the domain (Trinity). I want to
shut
| down the other domain controllers (Neo) and (Smith) by a local process
| activated by the ups service on Trinity. Is this possible, can i do it by
a
| command line or can i create a bat file to do the trick?
| Thanks in advanced...
|
|
| Francisco
|
|
 
R

Randy

In addition to the file Mr. Patrick mentioned, there is also a "restart.vbs"
on Microsoft's FTP (ftp://ftp.microsoft.com/ResKit/win2000/restart.vbs) that
uses the cscript.exe executable.

Example: cscript restart.vbs /s neo.domain.com /p /f (/s is the server
name; /p is poweroff and /f is to force the function).

I use this in the exact manner you want to use it. In a long power outage,
a 2200VA UPS runs the batch file shutting down three servers and a minute
later, shuts down the final server (where the UPS software resides).
 

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