Network Defrag on a shoestring budget

1.

 Network Defrag on a shoestring budget

 

Download JKDefrag

Download JKDefrag @ http://www.kessels.com/Jkdefrag/ unzip this into your ./windows/system32 directory. (You can put it somewhere else if you like)
2.

Download Pstools

Download PStools from http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx. Again I place all of these tools in my System32 directory.
3.

Add a scheduled task.

Start->All Programs->Accessories->System Tools->Scheduled Tasks. Create a scheduled task that runs something similar to the following:
psexec -c -w c:\windows\system32 -d \\* c:\windows\system32\jkdefragcmd -d 2 -l "jkdefrag.log" c: d: e: f: g: h: i:
This copies jkdefragcmd.exe command to every computer on the network and runs it. A log file is created in the System32 directory. I schedule this task for 12:01am. You need to run this task with an administrator account.
4.

Could you by any chance break down the syntax of using psexec to execute jkdefrag?

For those who want to know how it works.
First the psexec arguments and switches:
-c copy the file (jkdefrag) to the remote computer.
-w set the working directory to c:\windows\system32
-d don't wait for psexec to finish it's thing
\\* all the computers in the domain
Now the jkdefrag arguments and switches:
-d how verbose you want the log file to be
-l the logfile to create
c: d: e: f: g: h: i: The drive to preform the operation on. If you don't have a lot of partitions then you can just use c:
5.

Could you modify this to be better suited for just running it on a few machines?

Sure. Create a text file called computers.txt. List the machines you want to defrag on each line.
computer1
computer2
computer3
...
Now here is the command, I would put it in a .bat.
psexec -c -w c:\windows\system32 -d @computers.txt c:\windows\system32\jkdefragcmd -d 2 -l "jkdefrag.log" c: d: