Avatar of Tony Giangreco
Tony GiangrecoFlag for United States of America

asked on 

Windows 2003 Remote Shutdown Script

We have three servers in or network (1-2008, 2-2003). The UPS software that performs the automated shutdown in case of a power failure didn't work quick enough yesterday when we had a power outage. I was not there to manually shut them down and two went down hard before the UPS shutdown completed.

I have a restart script that use for remote maintenance and just modified it for shutdown instead of restart. I've put it on the server 2008 desktop for the office mgr to use incase of an emergency. Now I'd like to create a script she can execute to manually shutdown the two other servers.

Here is a quick script that runs on the 2008 server.

cd\
net stop "AeLookupSvc" /y
net stop "AppHostSvc" /y
net stop "QuickBooksDB20" /y
net stop "QBCFMonitorService" /y
net stop "Spooler" /y
....
shutdown /s /t /30 /f /d /p:4:1

I have a shutdown file very simular to this on the two 2003 servers in the domain. How do I automate the remote shutdown of both of them from the 2008 server properly?
Windows Server 2008Windows Server 2003Network Operations

Avatar of undefined
Last Comment
serchlop
SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Tony Giangreco

ASKER

Yes, I know that. Looking at the script above, what is the syntax to shutdown server #2 and #3 from Server #1?
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
ASKER CERTIFIED SOLUTION
Avatar of serchlop
serchlop
Flag of Mexico image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of serchlop
serchlop
Flag of Mexico image

sorry, i missed a parameter in shutdown

sc \\server2 "AeLookupSvc" stop
sc \\server2 "AppHostSvc" stop
....
shutdown /m \\server2 /s /t 30 /f /d /p:4:1
Avatar of serchlop
serchlop
Flag of Mexico image

sorry, another error, I should sleep a little more today...
sc uses server command service syntax

sc \\server2 stop "AeLookupSvc"
sc \\server2 stop "AppHostSvc"
....
shutdown /m \\server2 /s /t 30 /f /d /p:4:1
Avatar of serchlop
serchlop
Flag of Mexico image

if your server aren't in a domain, you can use psexec command using username and pass for the destination server.

the script could be like this

psexec \\server2 -u server2\username - p password net stop "AeLookupSvc" /y
psexec \\server2 -u server2\username - p password net stop "AppHostSvc" /y
psexec \\server2 -u server2\username - p password net stop "QuickBooksDB20" /y
psexec \\server2 -u server2\username - p password net stop "QBCFMonitorService" /y
psexec \\server2 -u server2\username - p password net stop "Spooler" /y
....
psexec \\server2 -u server2\username - p password shutdown /s /t 30 /f /d /p:4:1
Avatar of Tony Giangreco

ASKER

Hi serchlop,

I will schedule network downtime next week and try this out. I need to be onsite to manually the servers back on.
Avatar of serchlop
serchlop
Flag of Mexico image

If your servers support wake on lan, you can use free wolcmd tool to start them remotely, you should enable in routers or communication hardware.
Avatar of Tony Giangreco

ASKER

I tried this on Friday but had problems with the syntax. My maintenance window closed. I will try again this week.
Avatar of serchlop
serchlop
Flag of Mexico image

Ok, I use the following command to wake up a server in my company

Syntax
WolCmd.exe MAC IP NetworkMask PortWakeOnLAN

in another power on server I run

WolCmd.exe 001111222233 10.0.1.17 255.255.255.0 7

change 001111222233 for your MAC Address for your NIC in server you want to start
change 10.0.1.17 for the ip for your server
Windows Server 2003
Windows Server 2003

Windows Server 2003 was based on Windows XP and was released in four editions: Web, Standard, Enterprise and Datacenter. It also had derivative versions for clusters, storage and Microsoft’s Small Business Server. Important upgrades included integrating Internet Information Services (IIS), improvements to Active Directory (AD) and Group Policy (GP), and the migration to Automated System Recovery (ASR).

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo