PC Review


Reply
Thread Tools Rate Thread

Group Policy for Defrag

 
 
Morley Lee
Guest
Posts: n/a
 
      20th Mar 2006
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



 
Reply With Quote
 
 
 
 
Paul Williams [MVP]
Guest
Posts: n/a
 
      20th Mar 2006
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


 
Reply With Quote
 
 
 
 
Bill
Guest
Posts: n/a
 
      20th Mar 2006
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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
>
>
>



 
Reply With Quote
 
Robert Dorn
Guest
Posts: n/a
 
      21st Mar 2006
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

 
Reply With Quote
 
New Member
Join Date: Jul 2010
Posts: 1
 
      24th Jul 2010
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.
 
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
Defrag help !! defrag runs fine but doesnt defrag the drive bob Microsoft Windows 2000 3 14th Mar 2005 09:48 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 02:11 PM.