Jump to content

Recommended Posts

Posted

How do people shut down IT room computers at night?

 

Any scripts, apps or methods to share?

 

Also what times do you shut them down after the school day ends?

Posted
We shut them down at 4:30 , don't need to make any scripts or add 3rd party tools as the OS X Server has simple tick boxes with computers on and off times.
Posted

Const wshOK = 0

Const wshExclamation = 48

 

strComputer = "."

strShutdown = "shutdown.exe /f /s /m " & strComputer

strCounter = 1

Set objShell = CreateObject("Wscript.Shell")

strTimeLeft = 5

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!" & strComputer & "\root\cimv2")

 

Set colItems = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'explorer.exe'")

 

If colItems.Count = 0 Then 'a returned 0 meanins explorer is not present and no one is logged in

objShell.Run strShutdown 'since no one is logged in the shutdown command is issued.

End If

 

while strCounter < 11

 

intReturn = objShell.Popup("Your computer will shutdown in " & strTimeLeft & " minutes. Click OK to cancel the shutdown.",30, "Shutdown Pending", wshOK + wshExclamation)

 

If intReturn = 1 Then

objShell.Popup "Shutdown has been cancelled!", 6,"SHUTDOWN CANCELLED", wshOK + wshExclamation

Wscript.quit 0

End If

strTimeLeft = strTimeLeft - .5

strCounter = strCounter + 1

 

Wend

 

objShell.Run strShutdown

 

 

We use SCCM to run that @ 19:00 each night.

Posted (edited)

I believe there is software available, but I'm yet to come across anything free so have always used a script that remotely runs the shutdown.exe command for each PC from the server.

 

Takes a bit of time but other than that works fine.

 

 

echo off

:ICTSUITE
echo -- SHUTTING DOWN ICT SUITE --


:ICT-01
echo Checking if ICT-01 is still running.
ping –n 1 ICT-01 > NUL
if %errorlevel% == 0 goto ICT-02
echo -- SHUTTING DOWN ICT-01 --
shutdown /m \\ICT-01 /s /t 15 /c "This machine will shut down in 15 seconds..."


:ICT-02
echo ICT-01 is shut down.
echo Checking if ICT-02 is still running.
ping –n 1 ICT-02 > NUL
if %errorlevel% == 0 goto ICT-03
echo -- SHUTTING DOWN ICT-02 --
shutdown /m \\ICT-02 /s /t 15 /c "This machine will shut down in 15 seconds..."


:ICT-03
echo ICT-02 is shut down.
echo Checking if ICT-03 is still running.
ping –n 1 ICT-03 > NUL
if %errorlevel% == 0 goto ICT-04
echo -- SHUTTING DOWN ICT-03 --
shutdown /m \\ICT-03 /s /t 15 /c "This machine will shut down in 15 seconds..."

 

 

 

Probably overcomplicated matters a bit with this script but it does the job.

 

 

Edit - You need an @ before the echo lines. I removed this as @echo becomes a mention to someone named echo on the forums.

Edited by gtg93
  • Thanks 1
Posted

We used to use a script similar to that above. We are now using Impero.

 

Classroom workstations [As used by students] Shutdown at the end of school if they have not been used in the last half hour.

All stations [with some exceptions as requested by the Head] Shutdown notified at 6:30. Shutdown commences at 6:35.

 

The shutdown schedule is currently disabled for all stations because we have some late sessions and staff can't cope with coming to a station that they would expect to be on but they find it off. :mad:

Posted
+ GPO n scheduled task! I set the suite to 6pm and for near on a year I did not realise that some of the meetings ran till 7pm, till a staff member asked why the pc at the fron kept shutting down on its own lol
Posted
We use Impero to log inactive computers off after 45mins (which is how long a lesson lasts) and then SCCM turns any left on at around 9:15pm when any lettings have finished.
Posted
I can't take the credit, it was like this when I started here!

 

Either way, much simpler than my way. Took me ages to include every PC on site... Oh well...

Posted

We use a custom made executable along with Task Scheduler and a VBS script to add\edit the task as required.

 

2130hrs - Sleep

2300hrs - Wake and perform Windows Update install

2330hrs - Reboot and perform Windows update install and reboot again

0030hrs - Sleep

0630hrs - Wake and reboot

0700hrs - Ready for use

 

This runs every weekday on over 2000 machines. Works great.

Posted

Simple batch file that runs every day using psexec.

Student PCs shut down at 5pm, teacher pc's at 9pm (in case of parent evenings etc)

I sent out a calculation to all staff about how much electric is wasted!

 

************************************************************************

Potential Savings by having machines turned off for 10hours each night (9pm until 7am)

Average power consumption per PC when idle 110Watts * 200 Machines = 22000Watts or 22KWatts

kW/Hr Cost per Unit £0.09* 22KWatts = £1.98 saved per hour

£1.98 saved per hour * 10 hours (average overnight time) * 365 days = £7227

Potential Total savings = £7227 Per Year / £602.25 per month average.

Figures based on an average machine power consumption.

************************************************************************

  • Thanks 1
Posted (edited)
Check out PwrSmart from Networks Unlimited. Cloud based Power PC Management. No server to maintain, no upfront costs just save and pay per month. Edited by elsiegee40
Posted

Hi Daleksec

 

I have the exact same set up as your self but does not seem to run , was there anything else i need to set?Capture.JPG

Guest WMITTech
Posted
Task schedule or impero
Posted
Sysinternals psshutdown.

 

Free and fully MS!

 

That looks perfect.

 

Do you use it with wildcards to shut down multiple pcs?

Posted

I use a modified version of this (not my code)

 

Set WSHShell = WScript.CreateObject("WScript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")

strWarning = "Due to network maintenance, this computer must be restarted. You have 5 minutes to save your work from the start of this countdown. Sorry for any inconvenience caused. "
strDelay = 300	'Delay given in seconds; change this value to your preference, or set it to 0 to give no delay at all

'Open a text file of computer names
'with one computer name per line
Set oTS = oFS.OpenTextFile("C:\computers.txt")

'go through the text file
Do Until oTS.AtEndOfStream
'get the next computer name
'store it in variable strCompname
strCompname = oTS.ReadLine
	WshShell.Run "C:\Windows\System32\shutdown.exe -m \\" & strCompname & " -r -c " & Chr(34) & strWarning & Chr(34) & " -t " & strDelay	'Replace the "-r" switch with "-s" to make the computers shutdown instead
Loop
'close the text file
oTS.Close

 

It seems to be a bit hit and miss though as some computers shutdown and some don't from my testing so far despite them all being same make and model.

Posted
That looks perfect.

 

Do you use it with wildcards to shut down multiple pcs?

 

No, I use explicit lists as scheduled tasks.

 

Curriculum machines turn off at 16:00 (all pupil machines) Classrooms turn off at 17:30, Office machines 1 (main office, library, some admin machines) turns of at 16:30 Office machines 2 (HOS, BM, Finance Assistant) turn off at 18:00 and the command line options for that group allow the shutdown to be cancelled.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...