?
Solved

Shutting down workstations remotely and getting a report for success and failures

Posted on 2008-10-23
6
Medium Priority
?
380 Views
Last Modified: 2012-05-05
We've used shutdown.exe and BeyondExec with Windows Task Scheduler to shutdown workstations remotely. It doesn't always work, and in some cases machines get turned on afterwards for those buring the midnight oil. Does anyone out there know of a utility or trick that will shut down workstations remotely and provide a report about it's successes and failures to do so?
0
Comment
Question by:quiet_tree
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:gratex_ssd
ID: 22791881
1) script - shutdown, then wait, then ping, then serach eventlog on that machine for shutdown, and after -> make report, send mail with report
2) best language -> powershell but you can chose any scripting language that you are familliar
3) if there is a machine that is doing not shutdown, but it reboots -> then you have to troubleshoot bios settings...

hope that helps...
0
 
LVL 4

Accepted Solution

by:
Patrick49er earned 2000 total points
ID: 22792059
I use Sysinternals (located at: http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx) and use the psshutdown.  It is a more robust tool then what the Windows tool is.

To be able to run this batch, simply copy it and then change the paths to reflect where you put psshutdown.  This is pretty much the batch I use (with modifications to it for your purpose) to do a nightly reboot of my XP boxes.  It will log failed and successful shutdown commands.  You need to create a text file called NightlyAll.txt that has all the names of your workstations you want to have this command sent to.

title Nightly Shutdown v1.5
echo.
echo   Version date: 12/03/2007
echo   Version 1.5
echo.

rem  Version 1.5 added log entry for the computer being rebooted.
rem  Version 1.4 added date and space for the NightlyReboot.txt file.
rem  Version 1.3 added the log file for tracking systems that have reboot issues.
rem  Version 1.2 added the Logs folder in R:\Utility folder.

rem  Printed 07/25/2005

rem  This batch program is used to restart computers remotely.  This
rem  comes in handy for getting systems to a fresh state for the users
rem  for the next day, or performing a remote boot for maintenance
rem  purposes

  set a=
  set b=
  set c=
  set d=

:Main
  set a=NightlyAll
  for /F %%c in (R:\Utility\Checks\Lists\%a%.txt) do (
    set comp=%%c
    call :PowerOff
  )
goto :End

:PowerOff
  echo  Shutting down %comp%.
  echo. >> R:\Utility\Logs\Shutdown.log
  echo. >> R:\Utility\Logs\Shutdown.log
  echo  --------------------------------------------------------------------------------- >> R:\Utility\Logs\Shutdown.log
  echo  Shutting down %comp%. >> R:\Utility\Logs\Shutdown.log
  now >> R:\Utility\Logs\Shutdown.log
    C:\PSTools2_6\psshutdown -t 120 -m "Your system is being shutdown for maintenance purposes.  You have 2 minutes to save any unsaved data." -f \\%comp% >> R:\Utility\Logs\Shutdown.log
  echo  --------------------------------------------------------------------------------- >> R:\Utility\Logs\Shutdown.log
  if errorlevel 1 now >> R:\Utility\Logs\Shutdown.log
  if errorlevel 1 echo %comp% was not able to be shutdown. >> R:\Utility\Logs\Shutdown.log
  if errorlevel 1 echo. >> R:\Utility\Logs\Shutdown.log
goto :eof

:End
  echo.
  echo   The batch file has completed successfully!!!
  echo.
goto :eof
0
 

Author Comment

by:quiet_tree
ID: 22797719
Interesting.
The beyondexec software allows users to cancel the shutdown process. This feature is important to end-users. Does psshutdown have this feature?
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 4

Expert Comment

by:Patrick49er
ID: 22797761
Yes it does.  With the -c switch, you can allow the shutdown to be aborted by the interactive user.
0
 

Author Comment

by:quiet_tree
ID: 22814474
What does the following line in your script do:

now >> R:\Utility\Logs\Shutdown.log
0
 
LVL 4

Expert Comment

by:Patrick49er
ID: 22815355
The now statement captures the time and date that the command is executing; which in this case means what time the shutdown command is being sent.  If at a command prompt you type "now /?" you will get an explanation.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question