Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Recommended Posts

Hi guys,

Sorry if this has been asked before (I have looked ). Can anyone give me any advice/ guidence on the following problem I have.

The situation is I work for the IT dept of a school, probably about 600 pc`s maybe more. currently I have thenm all set to autopower on at 8:00AM

but there are an awfull lot of them that just get left on all night.

What I am looking for is a script or something that will run at a specific time and shut the pc`s down. The only issue I can possibly see is that all the students have there own logon on the domain. so the pc`s are usually locked when a student is not using them so the script would need to run in the background I guess.

Any help or advice would be great

Thanks in advance :thumbup

Share this post


Link to post
Share on other sites

A scheduled task would be what you would want. The question that remains is how, and to that end you would need to identify the main OS in question. Very easy if it's XP (and probably Vista) - look into the shutdown command.

You could try something like:

C:\> at 18:00 /interactive /every:M,T,W,Th,F,S,Su c:\windows\shutdown.exe -i -l 600 
-m “It is way past the time you should be at home. Come back tomorrow.”

Documentation:

AT

SchTasks - more proper for XP perhaps

Shutdown

Share this post


Link to post
Share on other sites

Don't know if all OS's have shutdown.exe so you can google and download it as the previous thread says. I believe the one I have used is a stand-alone executable that shuts down the PC and can be called through a script. Or a batch file called from a scheduled task, etc., whichever you like.

Share this post


Link to post
Share on other sites

Here is a vbs script that you might be able to use. Since it using WMI you can run it

against remote machines.

 Const LogOff = 0,  Shutdown = 1, Reboot = 2,PowerOff = 8
Dim ObjOS, strComputer, StrOS, Wmi
strComputer = "."
Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set ObjOS = Wmi.ExecQuery("Select * from Win32_OperatingSystem")
For Each StrOS in ObjOS
'-> 4 Means Force The System
StrOS.Shutdown(Shutdown + 4)
Next

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...