PC Review


Reply
Thread Tools Rate Thread

Re: Using group policy to schedule tasks

 
 
Ullattil Shaji[MSFT]
Guest
Posts: n/a
 
      8th Jul 2003
Hi,
Running it as a user logon script (logon script runs as the user) might
not always work because a non administrator user might not be able to reboot
the machine.

If you know when the machine boots up, when you want it to be shutdown, you
can probably run it as a startup script. Will that work?

HTH,
-Shaji.


--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Jim" <(E-Mail Removed)> wrote in message
news:7ad301c344ba$34fdcd00$(E-Mail Removed)...
> I'd like to use group policy to schedule a reboot of all
> client computers (Win2K/WinXP), but there is no policy
> specifically for this that I've found. I created a
> policy to run the following logon script:
>
> at 5:00 shutdown /l /r /y /c
>
> The problem is that this schedules the task at each logon
> with a new task id each time. Over time this could
> result in hundreds of occurances of the same task.
>
> It seems like their should be an easier way to do this,
> but I'm not finding it so far.
>
>



 
Reply With Quote
 
 
 
 
New Member
Join Date: Jun 2008
Posts: 1
 
      11th Jun 2008
A better option than the at command especially if you are working with xp and server 2000/2003 is the schtask command.

I have the 800 odd computers at the school I work at executing a system shutdown at 6pm, well we are supposedly an eco school after all and people were leaving computers on overnight and over weekends even holiday periods.
So I created 2 batch files stored on the server and deliver one as a startup script this creates a scheduled task using schtask. Because I use the network administrator account to create it no-one can interfere with it or overrride it when it kicks in. This task then calls the 2nd batch file, which executes the shutdown command with a 5 minute countdown and will shut the machine off at exactly 6pm. There is nothing to prevent a user turning the machine back on again after 6pm it's just at 5:55pm the scheduled task executes the 2nd batch file which after the 5 minute countdown the puts the computer off.
It has also improved our policy changes as each machine is guaranteed to be off in the morning as (at least for the majority of the school's computers) they are unattended at 6pm.
Because I used schtask instead of at it only creates the one job on each startup and because I scheduled it as a 'run once' setting, the task if it gets executed is automatically removed from the scheduled task list.
I can send you the script files if you want to send me an e-mail address but it really does work effectively as a couple of times nowI have been there after 6pm and seen with my own eyes entire computer suites shut themselves down, it's really something to see!

Mavericks Ghost
 
Reply With Quote
 
 
 
 
New Member
Join Date: Jul 2008
Posts: 1
 
      16th Jul 2008
IS there any way you can post the scripts mentioned above?
 
Reply With Quote
 
New Member
Join Date: Sep 2008
Posts: 2
 
      17th Sep 2008
I would also like to see how the batch file method works. I have tried it myself by normal users don't seem to be able to create tasks with schtasks that run as higher level users (such as required to shutdown a pc)

thanks
 
Reply With Quote
 
New Member
Join Date: Sep 2008
Posts: 1
 
      21st Sep 2008
ditto....this is exactly what I need to do....can I get the scripts?
 
Reply With Quote
 
New Member
Join Date: Dec 2008
Posts: 1
 
      30th Dec 2008
have you got the script guys ? can you share ? can you send me the script ?
 
Reply With Quote
 
New Member
Join Date: Sep 2008
Posts: 2
 
      30th Dec 2008
Nope... I think its just BS because I've tried all this before with no success. I was thinking this guy had the magic solution but apparently not.
 
Reply With Quote
 
New Member
Join Date: Jun 2010
Posts: 2
 
      8th Jun 2010
Hi mavericks_ghost,

Do you think is possible to send me instructions how to schedule a bat file to run in GPO?
Please e-mail me. Thank you.



QUOTE=mavericks_ghost]A better option than the at command especially if you are working with xp and server 2000/2003 is the schtask command.

I have the 800 odd computers at the school I work at executing a system shutdown at 6pm, well we are supposedly an eco school after all and people were leaving computers on overnight and over weekends even holiday periods.
So I created 2 batch files stored on the server and deliver one as a startup script this creates a scheduled task using schtask. Because I use the network administrator account to create it no-one can interfere with it or overrride it when it kicks in. This task then calls the 2nd batch file, which executes the shutdown command with a 5 minute countdown and will shut the machine off at exactly 6pm. There is nothing to prevent a user turning the machine back on again after 6pm it's just at 5:55pm the scheduled task executes the 2nd batch file which after the 5 minute countdown the puts the computer off.
It has also improved our policy changes as each machine is guaranteed to be off in the morning as (at least for the majority of the school's computers) they are unattended at 6pm.
Because I used schtask instead of at it only creates the one job on each startup and because I scheduled it as a 'run once' setting, the task if it gets executed is automatically removed from the scheduled task list.
I can send you the script files if you want to send me an e-mail address but it really does work effectively as a couple of times nowI have been there after 6pm and seen with my own eyes entire computer suites shut themselves down, it's really something to see!

Mavericks Ghost[/QUOTE]
 
Reply With Quote
 
New Member
Join Date: Jun 2010
Posts: 2
 
      16th Jun 2010
Is this a correct schedule bat script ?:
schtasks /create /RU SYSTEM /SC WEEKLY /TN PCTest /TR "C:\Temp\PCCleanup.bat" -v -tD /ST 23:30:00 /SD 06/09/2010
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get correct group policy to Vista machine - using wrong group policy jm Microsoft Windows 2000 Active Directory 1 20th Dec 2006 12:12 PM
Today's Group Policy Webcast (Group Policy Processing) Mark Williams [MSFT] Microsoft Windows 2000 Group Policy 0 10th Nov 2004 07:46 PM
Next Group Policy webcast (Applying Group Policy) Mark Williams [MSFT] Microsoft Windows 2000 Group Policy 0 11th Oct 2004 04:43 PM
group policy editors + other resources of group policy information ... Akhlaq Khan Microsoft Windows 2000 Active Directory 0 24th Jul 2003 11:29 AM
group policy editors + other resources of group policy information ... Akhlaq Khan Microsoft Windows 2000 Group Policy 0 24th Jul 2003 11:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:59 AM.