Mark Minasi's Tech Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
nikolas.e

Senior Member
Registered:
Posts: 146
Reply with quote  #1 
Case: Yesterday our Electricity power was cut off in our company network. Took some seconds but the generator switched on immediately and everything was running  under the generator. (I have asked and verify that it can run up to 48 hours)

Today all went bad. I guess the generator could not handle all this power after users came to work either (Air conditioning,Computers,Servers and goes on). Generator went down. So we where left with the UPS running for the Servers for some time. We had time and we did manually shutdown our system but caught me and others unprepared for this situation. 

I did study about the UPS Model that is supporting some of our server but i have found out that if you do not add a special card it cannot support other server for power failure shutdown command except only one which is communicating through usb with the ups.


Anyway my main question is this : Can anyone knows how to create a batch file in order to type in my servers host names and in case there is a failure of electricity and ups runs on battery i will be able to shutdown the servers using the batch file only and not have to switch between remote desktops to shutdown each server seperately?

__________________
Just call me the 1000Questionsguy
0
donoli

Senior Member
Registered:
Posts: 546
Reply with quote  #2 
shutdown -m \\computer_name is the command for a remote shutdown from a command prompt. I don't know if the \\computer_names can be separated with commas.  You would have to test that.  If you wanted to have a separate batch file on each server, the command would be shutdown -s

shutdown /? will give you the help list.
0
nikolas.e

Senior Member
Registered:
Posts: 146
Reply with quote  #3 
Thank you for the info. I have found an alternative solution also using a free app but its best to try create a batch file and test to see results. 


Thanks again

__________________
Just call me the 1000Questionsguy
0
donoli

Senior Member
Registered:
Posts: 546
Reply with quote  #4 
What's the name of the free app?
0
nikolas.e

Senior Member
Registered:
Posts: 146
Reply with quote  #5 
Pdq inventory. It does other things also like reports and auditing but also the option to restart multiple systems with message
__________________
Just call me the 1000Questionsguy
0
donoli

Senior Member
Registered:
Posts: 546
Reply with quote  #6 
Ok thanks
0
lady_mcse

Avatar / Picture

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 92
Reply with quote  #7 
Don't forget about Powershell ... 

With that you could write a script that interrogates AD for a current list of all your servers that exist, then run thru that list and perform the command on each one.  That way you're not stuck with a script that might get 100% of your servers today but only 70% of the servers by the time you get around to really needing it (because of fluctuations in your server inventory).  
0
Mark

Hacked Mark's Facebook Account
Registered:
Posts: 273
Reply with quote  #8 
Anne's right -- it'd be pretty simple.  Either

$Targets = "Serv01, ExchSvr04, Sqlbox01"
stop-computer -computername $Targets

Or

(Get-ADComputer -filter {OperatingSystem -like "server" -and Enabled -eq "True"}).name | stop-computer

Should either (1) stop the explicitly named computers in the first case, or (2) extract the names of the member servers and stop them.

I have NOT tested these syntaxes as I don't have a virtual network set up.  But something like that should work.

__________________
May I ask that everyone please populate the first name and last name in your user account profile.  Thanks!
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.