Home > Windows Server Tips > Windows Server Monitoring and Management > How to automate Windows Server 2003 defrag
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WINDOWS SERVER MONITORING AND MANAGEMENT

How to automate Windows Server 2003 defrag


Serdar Yegulalp, Contributor
09.17.2007
Rating: -4.83- (out of 5)


Expert advice on Windows-based systems and hardware
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Related Windows defragmentation and command-line resources

Top 10 Windows Server 2003 command-line functions.

Script to defrag all Windows volumes.

Microsoft Windows Server 2003's DEFRAG command-line tool can be configured to run automatically without the need for manual administrative maintenance.

Setting up Windows Server 2003 DEFRAG to run automatically is relatively simple:

1. Go to Control Panel -> Scheduled Tasks -> Add Scheduled Task to open the Scheduled Task Wizard and then click Next.

2. Hit the Browse button, search for the %SystemRoot%\system32\defrag.exe file and run it.

3. Choose a name and schedule and then click Next. A heavily trafficked Windows 2003 server will probably benefit from daily defragmentation; a less-trafficked server can be defragmented weekly.

4. Choose a start time -- ideally when the server load will be slow.

5. Enter the username and password for a local administrator account. DEFRAG must run under the auspices of an administrator account that has the right to manage local disks. But this does not necessarily have to be a full administrator account. You can set up a specially created local account that only has disk-management privileges if you want.

6. Click Next and select "Open Advanced Properties…" and click Next again.

7. Under the Tasks tab, there are a few options that can be set. If you want to modify the DEFRAG command-line parameters, you can do so here. Generally, DEFRAG needs no parameters to run properly. The only exception is the –f switch, which forces DEFRAG to run when there is little free space. But DEFRAG shouldn't need to be run with the –f switch as a scheduled job.

8. Click OK to approve the job.

Windows Server 2003 is now configured to automatically run the DEFRAG command-line tool based on the schedule you specified.

A free third-party tool I've used as a capable substitute for Windows Server 2003 DEFRAG is JKDefrag. It is available in a command-line/scriptable edition and uses the same defrag APIs as the Windows Server 2003 DEFRAG tool, but with many more options. If you use JKDefrag, read the documentation thoroughly -- not all the command-line switches are suitable (or even needed) for a Windows Server environment.

About the author: Serdar Yegulalp is editor of Windows Insight (formerly the Windows Power Users Newsletter), a blog site devoted to hints, tips, tricks and news for users and administrators of Windows NT, Windows 2000, Windows XP, Windows Server 2003 and Vista. He has more than 12 years of experience working with Windows, and contributes regularly to SearchWinComputing.com and other TechTarget sites.

Rate this Tip
To rate tips, you must be a member of SearchWindowsServer.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Windows Server Monitoring and Management
When (and when not) to use Windows server failover clustering
Backing up virtual servers: Top methods for Windows machines
Troubleshoot Windows server clusters with ClusDiag
Using ClusDiag for enhanced Windows server cluster reporting
Take control of server clusters with Microsoft's ClusDiag tool
What's in a name: Keeping track of virtual servers
Analyze server history with new tool in Windows 2008
Determining the cause of Windows server hang
Preparing to troubleshoot a hung Windows server
Why do Windows servers hang?

Microsoft Windows Server 2003 Administration
Validating Windows server clusters with ClusPrep
Exploring the Windows Server 2003 Resource Kit: Clusfileport.dll
Exploring the Windows Server 2003 Resource Kit: Cmdhere.inf and CMGetCer.inf
Avoid DC restoration problems with authoritative restore
Exploring the Windows Server 2003 Resource Kit: Confdisk.exe
Exploring the Windows Server 2003 Resource Kit: Compress.exe and Expand.exe
Exploring the Windows Server 2003 Resource Kit: Clusterrecovery.exe
How to use Microsoft's IIS Diagnostics Toolkit
How to install the Microsoft IIS Diagnostics Toolkit
How to use AuthDiag 1.0 to troubleshoot IIS problems
Microsoft Windows Server 2003 Administration Research

Windows Server Monitoring and Administration
A first look at Storage Explorer for Windows Server 2008
Tips for Windows domain controller optimization
Take control of server clusters with Microsoft's ClusDiag tool
Analyze server history with new tool in Windows 2008
Determining the cause of Windows server hang
Preparing to troubleshoot a hung Windows server
Why do Windows servers hang?
Microsoft tool simplifies Windows server cluster configuration
Exploring the Windows Server 2003 Resource Kit: Clusfileport.dll
Exploring the Windows Server 2003 Resource Kit: Cmdhere.inf and CMGetCer.inf

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2004 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts