Link to home
Start Free TrialLog in
Avatar of AZZA-KHAMEES
AZZA-KHAMEESFlag for Bahrain

asked on

Apply shutdown policy after office hours in a Domain

Hello,

Can someone help in this please. I read so many threads and didn't get the answer i needed. i want to apply a shutdown policy on some selected computers in my domain after office hours after checking out that these PC were idle, logged off or locked. but the problem i'm facing here is that some employees ( or ADMINS) SOMETIME are leaving their PC ON downloading files or runningscheduled jobs  after office hours and dont want thier PC to be shutted down!!

i need to apply this through Group Policy. but as i understood i need to use a third party tool for the scheduling part.

regards,
A.A
Avatar of Jay_Jay70
Jay_Jay70
Flag of Australia image

Hi AZZA-KHAMEES,

why not use this free tool
http://www.sysinternals.com/Utilities/PsShutdown.html

set up a file on your server that shuts down all machine and run it when you want it too, or set as a scheduled task on the server

you will need admn rights on each machine you want to shutdown

Cheers!
Avatar of AZZA-KHAMEES

ASKER

thank u jay jay for your instance reply. but for example i would like to shut down some PCs at 3 pm automaticlly for example without using scheduled tasks because users have admin rights on thier PCs, where can i spicify the time?

regards,
thats no problem :)

you can set a scheduled task on your server, that then sets off the script, which then affects all machines, users wouldnt even see it and in no way could edit it as it sits on your server..

sorry that i can give out the script, i am learning a bit of scripting at the moment though, so if you can get a direct script given to you, send me an email and ill see what i can for you yeah?
AZZA-KHAMEES,

oops wrong question mate sorry!
Avatar of Naser Gabaj
Greetings AZZA-KHAMEES,

This thread talking about the same subject, have a look and let me know:

http://groups.google.com/group/microsoft.public.windows.server.scripting/browse_thread/thread/96b8d153e9874bf3/699628a087dd88d6

Good Luck!

Naser
Also, you can implement OU's called shutdwon GP, Move those users that you wanted to shutdown thier machines, and then implement the policy only on those OU's only, using (Startup/Shutdwon) scripting under the following Path:

Computer configuration>windows settings>scripts(Startup/Shutdwon).

HTH

Good luck

Naser

Naser,

how does that work with sheduling though?
shutdown.exe is built into the windows OS (well in 2K it was part of the resource kit) but you can download it here.

http://www.mameworld.net/ultrastyle/download.htm

run shutdown.exe /? to see the switches that you want to add.
then just create a batch file with those switches
then just either create a local scheduled task or a domain GPO to run that batch file.





Avatar of JimsZ
JimsZ

first off... you can create a batch file such as this for each pc.  Just put that into a text msg, then rename as .bat   This would shut each computer down in 300 seconds.  They can manually stop it by clicking start-run and typing shutdown -a


shutdown -t 300 -s -f -c shutdown_time

The shutdown command above will tell the computer the command, -t 300 is 300 seconds (could be changed to 900, etc).  The -s is to shutdown, -f is to force any running applications to close, -c is to comment the "shutdown_time"



Or you can shut them down on your end by typing in

shutdown -m \\computername -t 300 -s -f -c shutdown_time

You could create a batch file for each computer or create one batch file with all computers to run on domain controller or server ran with administrative rights.
thanks all for your efforts, i found this freetool " http://www.beyondlogic.org/solutions/shutdown/shutdown.htm " i tested it, it creates a scheduled task in the user machine and runs it then delete it . it was cool but the problem was if this senario appears, if the user logged in, policy was applied, scheduled task was created, then the user shuts down his PC before the job runs!!! when he logs in the next day and the policy creates the new scheduled job it will not run cause thier will be 2 scheduled tasks (i found out this conclusion after testing)

does anyone knows how to delete the scheduled task when the computer shutsdown???

thanks
ASKER CERTIFIED SOLUTION
Avatar of Naser Gabaj
Naser Gabaj
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial