Group Policy for Defrag

Discussion in 'Microsoft Windows 2000 File System' started by Morley Lee, Mar 20, 2006.

  1. Morley Lee

    Morley Lee Guest

    I want to see if there is a way to create a group policy to run defrag on
    all the Windows XP pc's in a Windows 2003 network. Instead of going to each
    pc and setting up a new task schedule.

    Any help would be greatly appreciated.

    Thanks,
    Morley
     
    Morley Lee, Mar 20, 2006
    #1
    1. Advertisements

  2. Without implementing additional third-party extensions, if such exist, you
    could configure a start-up script that schedules a defrag or distribute a
    script that you package up that schedules or initiates a defrag. The former
    will be easier.

    Both will need to set a timer or schedule, as both run on start-up. User
    assignment/ publishing won't help as you can't guarantee users will initiate
    it.

    Tools such as SMS are better suited to such a task.

    --
    Paul Williams
    Microsoft MVP - Windows Server - Directory Services
    http://www.msresource.net | http://forums.msresource.net
     
    Paul Williams [MVP], Mar 20, 2006
    #2
    1. Advertisements

  3. Morley Lee

    Bill Guest

    Here's how I'd do this:

    1) Create a share that every computer in the domain can access.

    2) There are two commands we need to use here. AT will schedule the job.
    (at /? will list all of the options.) DEGRAG will run the disk defragmenter
    from the command line. Write a batch script which runs DEFRAG using the AT
    command at some specified interval. Something like: at \\127.0.0.1 12:00:00
    /every:1 defrag c:

    This will schedule a defrag on the 1st of the month at noon on the C:
    volume, on "localhost" (\\127.0.0.1)

    Save this as a BAT or CMD file and place it in your share created in step 1.

    3) In GPMC, add this batch file to Computer configuration>>Windows
    Settings>>Scripts>>Startup section. The next time the computer boots, it
    will run this startup script and add the job to the task scheduler.

    "Morley Lee" <> wrote in message
    news:%...
    >I want to see if there is a way to create a group policy to run defrag on
    > all the Windows XP pc's in a Windows 2003 network. Instead of going to
    > each
    > pc and setting up a new task schedule.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks,
    > Morley
    >
    >
    >
     
    Bill, Mar 20, 2006
    #3
  4. Morley Lee

    Robert Dorn Guest

    What I did i wrote a batch file and assigned it to computer scripts startup...i used the schtasks command....at a command prompt type in schtasks /? then schtasks /create /?


    schtasks.exe /create /SC WEEKLY /D SAT /TN fragme /TR "\"C:\windows\system32\defrag.exe\"c: -f" /ST 00:45:00 /SD 02/22/2005 /RU SYSTEM

    same can be done to auto reboot machines

    schtasks.exe /create /SC DAILY /TN rebootme /TR "\"C:\windows\system32\shutdown.exe\"-f -r" /ST 04:45:00 /SD 02/22/2005 /RU SYSTEM
     
    Robert Dorn, Mar 21, 2006
    #4
  5. Morley Lee

    tenroc2o0o

    Joined:
    Jul 24, 2010
    Messages:
    1
    Likes Received:
    0
    My Defragmentation Setup Script

    Here's the code I just implemented on one of my networks:

    Code:
     @echo off
     echo Checking Defragmentation Settings...
     at \\127.0.0.1 | findstr /il "defrag.exe" > nul
     if %ERRORLEVEL% EQU 0 GOTO DefragSetup
     
     echo Setting up Defragmentation Schedule...
     at \\127.0.0.1 20:00:00 /every:1,10,20 defrag.exe C:
     
     :DefragSetup
     echo Defragmentation of Hard Disk is Scheduled.
     
     
    tenroc2o0o, Jul 24, 2010
    #5
    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. student

    group policy objects

    student, Jul 16, 2003, in forum: Microsoft Windows 2000 File System
    Replies:
    0
    Views:
    471
    student
    Jul 16, 2003
  2. Reed Wiedower

    DFS group policy

    Reed Wiedower, May 4, 2004, in forum: Microsoft Windows 2000 File System
    Replies:
    0
    Views:
    266
    Reed Wiedower
    May 4, 2004
  3. Guest

    Group Policy - File System

    Guest, Jul 21, 2004, in forum: Microsoft Windows 2000 File System
    Replies:
    1
    Views:
    189
    Jerold Schulman
    Jul 22, 2004
  4. RR

    Defrag doesn't defrag completely

    RR, Jun 26, 2005, in forum: Microsoft Windows 2000 File System
    Replies:
    1
    Views:
    262
  5. Morley Lee

    Group Policy for Logon Hours/Forced Loggoff

    Morley Lee, Mar 21, 2006, in forum: Microsoft Windows 2000 File System
    Replies:
    2
    Views:
    687
    mwest
    Mar 23, 2006
Loading...

Share This Page