# SETTING SCHEDULE TASK TO SHUTDOWN PC'S USING GROUP POLICIES



## dalwnt (Dec 20, 2011)

SETTING SCHEDULE TASK TO _SHUTDOWN PC'S_ USING GROUP POLICIES
I am very bad in GPO but i have seen some informations how to create it but if someone can be so friendly and help me step by step with a shortly explanations how do i make all LAN pcs to shut down at 23:00 every day because in our company theyre leaving all pcs on and i cannot shut them down daily one by one.. they dont care...
Is there any way to do it please?

P.S the servers that are on Do:nonono:main shall not be shut down with that command

http://www.google.com/url?sa=t&rct=...yPDeAQ&usg=AFQjCNFoihNZWY_BqRJARoMSPM-4X3xN_Q


----------



## buzza24 (Mar 27, 2008)

Hi there,

Firstly, I don't a problem with people leaving their PC on over night. Usually say to people to turn their PC off if they're not going to be using them over the week, but are ok to leave them on during the week. However if you still want to set schedule tasks then this is how I would do it.

You need a shared directory that all the computers can access for the following scripts.

Create a Batch script called *Shutdown.bat* and save it into the shared folder. Edit the file with the following.


```
schtasks /create /F /sc Daily /mo 1 /St 23:00 /tn "PC Shutdown" /tr "Shutdown /s /f /t 05"
```
Then in Group Policy, create a new policy called *Shutdown Script Group Policy*. Edit the policy and expand to *Computer configuration > Windows Settings > Startup*. In the *Properties* of startup, add your script. Make sure it is the network path (i.e. \\server\scripts\shutdown.bat). Then OK out of it and go test it on some PCs.

You may find that you may need to make changes to the scripts, but this has worked for me in the past for other similar functions.

Good Luck :grin:

Note: The schtask function works on Windows XP and Windows 7.


----------



## buzza24 (Mar 27, 2008)

Also side note, when creating the Group Policy, Under Security Filtering, ensure that only your computers are added. Using the group *Authenticated Computers* will ensure that servers aren't shutdown.


----------



## dalwnt (Dec 20, 2011)

hey Buzza thanks alot for all this. I guess i almost am done.
Now the problem is i took a screenshot where i am at the last step i am not sure how do i add the computers which have to be shut down. Im unable to find the Authenticated Computers group.. Is it possible to selet which pcs should be shut down and which not? Is a selective chance?


----------



## buzza24 (Mar 27, 2008)

Hi dalwnt,

Have a look at the attached image. In the Group Policy Management Console, you will see on the right hand side the section Security Filtering... that is where list the computers/groups that the Group Policy will be applied to.










It looks like you are trying to apply the Group Policy to the Active Directory object. You actually sign the use the Group Policy management to assign the policy to the group.


----------



## dalwnt (Dec 20, 2011)

hey again, Im unable to find GPMC on my windows server 2003... ive found a site Download GPMC where looks like i have to download and install it. Is that true? Shall i install this on my server?


----------



## dalwnt (Dec 20, 2011)

its not working mate... Im following all the steps and its not shutting down any pc...


----------



## moscripto (May 29, 2012)

Do you still have this issue? If yes, I believe we can help each other. I am developing Windows automation product with an integrated scheduler that you can easily schedule a shutdown for each PC and as it is in the early stage, I am looking for feedback from potential users.

As posting a link here would clearly be viewed as advertising, if you are interested please message me and I'll send you all the details.


----------



## dalwnt (Dec 20, 2011)

great idea. msg me the link..


----------



## moscripto (May 29, 2012)

Unfortunately, I am not able to send you a private message, I got this error:
"dalwnt has chosen not to receive private messages..."

Anyway, I'll post it here, I apologize if it's not appropriate.

I have written an article of how one can schedule a restart here: Scheduling a weekly Windows restart | Moscripto - a lightweight and Easy to use Windows Automation Tool

Download and install it on as many PCs you need.

Follow that guide, but instead of System.Restart() use System.Shutdown(). In the last step let all the weekdays stay checked.

If you have any questions and feedback, feel free to email me directly. If this works for you, email me and I'll send you a free license.


----------

