Re: Using group policy to schedule tasks

Discussion in 'Microsoft Windows 2000 Group Policy' started by Ullattil Shaji[MSFT], Jul 8, 2003.

  1. 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" <> wrote in message
    news:7ad301c344ba$34fdcd00$...
    > 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.
    >
    >
     
    Ullattil Shaji[MSFT], Jul 8, 2003
    #1
    1. Advertisements

  2. Ullattil Shaji[MSFT]

    mavericks_ghost

    Joined:
    Jun 11, 2008
    Messages:
    1
    Likes Received:
    0
    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
     
    mavericks_ghost, Jun 11, 2008
    #2
    1. Advertisements

  3. Ullattil Shaji[MSFT]

    drharvey

    Joined:
    Jul 16, 2008
    Messages:
    1
    Likes Received:
    0
    IS there any way you can post the scripts mentioned above?
     
    drharvey, Jul 16, 2008
    #3
  4. Ullattil Shaji[MSFT]

    ibanezfoo

    Joined:
    Sep 17, 2008
    Messages:
    2
    Likes Received:
    0
    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
     
    ibanezfoo, Sep 17, 2008
    #4
  5. Ullattil Shaji[MSFT]

    rkjohn

    Joined:
    Sep 21, 2008
    Messages:
    1
    Likes Received:
    0
    ditto....this is exactly what I need to do....can I get the scripts?
     
    rkjohn, Sep 21, 2008
    #5
  6. Ullattil Shaji[MSFT]

    coolboy

    Joined:
    Dec 30, 2008
    Messages:
    1
    Likes Received:
    0
    have you got the script guys ? can you share ? can you send me the script ?
     
    coolboy, Dec 30, 2008
    #6
  7. Ullattil Shaji[MSFT]

    ibanezfoo

    Joined:
    Sep 17, 2008
    Messages:
    2
    Likes Received:
    0
    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.
     
    ibanezfoo, Dec 30, 2008
    #7
  8. Ullattil Shaji[MSFT]

    giorgiarian

    Joined:
    Jun 8, 2010
    Messages:
    2
    Likes Received:
    0
    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]
     
    giorgiarian, Jun 8, 2010
    #8
  9. Ullattil Shaji[MSFT]

    giorgiarian

    Joined:
    Jun 8, 2010
    Messages:
    2
    Likes Received:
    0
    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
     
    giorgiarian, Jun 16, 2010
    #9
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Akhlaq Khan

    group policy editors + other resources of group policy information ...

    Akhlaq Khan, Jul 24, 2003, in forum: Microsoft Windows 2000 Group Policy
    Replies:
    0
    Views:
    889
    Akhlaq Khan
    Jul 24, 2003
  2. Guest

    Using Group Policy To Schedule a Task

    Guest, Oct 24, 2003, in forum: Microsoft Windows 2000 Group Policy
    Replies:
    0
    Views:
    390
    Guest
    Oct 24, 2003
  3. Mark Williams [MSFT]

    Next Group Policy webcast (Applying Group Policy)

    Mark Williams [MSFT], Oct 11, 2004, in forum: Microsoft Windows 2000 Group Policy
    Replies:
    0
    Views:
    414
    Mark Williams [MSFT]
    Oct 11, 2004
  4. Mark Williams [MSFT]

    Today's Group Policy Webcast (Group Policy Processing)

    Mark Williams [MSFT], Nov 10, 2004, in forum: Microsoft Windows 2000 Group Policy
    Replies:
    0
    Views:
    446
    Mark Williams [MSFT]
    Nov 10, 2004
  5. Michael J. Davis

    Group Policy Management Console - Group Policy Results XP Sp2...

    Michael J. Davis, Jun 13, 2005, in forum: Microsoft Windows 2000 Group Policy
    Replies:
    2
    Views:
    2,119
    Darren Mar-Elia
    Jun 17, 2005
Loading...

Share This Page