Solved

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

Posted on 2008-10-23
6
379 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 500 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

705 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