We help IT Professionals succeed at work.

how to force workstations to shut down through group policy

Medium Priority
633 Views
Last Modified: 2012-05-06
How do I schedule workstations to shut down through group policy?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2013

Commented:
There is no native group policy setting that I know of
You can use different tools to do this
You can use the shutdown command or use psshutdown
http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx
Thanks
Mike

Author

Commented:
I need to be able to schedule workstation shutdowns.
you can not
either you add the shutdown script which shuts down a computer on a schedule (shutdown command) or you set logging hours for workstations

Author

Commented:
can you add a shutdown script through group policy?
I think this may work for you http://www.experts-exchange.com/OS/Miscellaneous/Q_22839261.html#a19922572 this solution was alredy here so check it and let us know if it is what you wanted

Author

Commented:
I don't want to have to go to every pc, and I don't want to manually connect to each pc.
you don't have to you check this http://support.microsoft.com/kb/317371 you only have to create a *.bat file with the rigth arguments and run it that if you are the administrator all thos PC gonna get shot off.

Author

Commented:
So how do I schedule this? It looks like a command line tool. also is there a version for xp and server 2003?
you just have to use schedule task  on the server or your work station to run the *.bat that you already created, make sure that the credentials that you gonna provide are administrators ones.

Author

Commented:
OK, I'm a little weak on writing code. I am familiar with scheduled tasks. so lets say I have 2 pcs named bob and tom. how would I write the script to force them to shutdown. if we need to include the admin credentials, then lets say they are administrator and password. thank you.
so I think it would be eg.
at \\bob 23:00 /every:M,T,W,Th,F "runas /user:administrator password shutdown -s"
at \\tom 23:00 /every:M,T,W,Th,F "runas /user:administrator password shutdown -s"

Author

Commented:
so I create a batch file and schedule it with scheduled tasks right? do I need to install the tool you were just talkin about?
ok first you create a txt file then you write in it like this
shutdown \\Bob
shutdown \\tom
then you save the file and close it, after it's saved you go where the file is and change the extension txt for bat, and thats it, you have created your first batch code, now you use schedules task stuff

Author

Commented:
it looks like you have time and dates on this script. wouldn't that be set with the scheduled tasks? how would I write it if I wanted it to shutdown the workstation now, and then schedule when it runs with scheduled tasks?
Roads_Roads way:

at \\bob 23:00 /every:M,T,W,Th,F "runas /user:administrator password shutdown -s"
at \\tom 23:00 /every:M,T,W,Th,F "runas /user:administrator password shutdown -s"  
you don't have to use schedules task
and this way:
shutdowncode.bat

shutdown \\Bob
shutdown \\tom
you will need to use schedules task (be sure to provide Administrator rigths when creating the new task)

Author

Commented:
I don't understand what you just said. on one line it says I don't have to use scheduled tasks and the other it says I do. I would like to use scheduled tasks. are you saying all I have to do is type shutdown \\bob in a .bat file and it will shutdown the pc bob in scheduled tasks?
if you wanna use schedule task just do this:

shutdowncode.bat

shutdown \\Bob
shutdown \\tom
 
you will need to use schedules task (be sure to provide Administrator rigths when creating the new task)

Author

Commented:
I'm testing this on a spare workstation. the name of the workstation is 60NZ141 so I wrote the line like this:
shutdown \\60NZ141

is this right? it's not working. when I select the run now in scheduled tasks I get a command prompt that pops up and goes away quickly, but the workstation doesn't shutdown. do I need to use the -s switch somewhere?
ok I figured it out:
shutdown -m \\computername -s

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.