Scheduled Defrag in Windows 2008 R2 disabled by default

I was at a customer yesterday and got a tip about the defragmentation in Windows 2008 R2. It came up when we where discussing about the SCOM and an alarm in Operations Manager regarding fragmentation on monitored volumes.

I thought that it was doing things automatically but the scheduled task that is responsible for the defragmentation is disabled by default. Now there is different best practices regarding if you should be defragmenting the volumes if it is virtual machines residing on a SAN. If you have physical servers with local drives I would definitely say that you should be doing defragmentation.

So how do you see if your defragmentation task is enabled or not?

Open the Task Scheduler from Administrative Tools and go to Defrag

Then if you check the properties by changing to triggers on the scheduledDefrag task and look, you will see that it is disabled by default, double click on task and you can edit it.

You can then press the edit button and enable the task

Then your task is enabled and on every wednesday at 01:00 the defrag task will be running. As I wrote above, enabling this in a virtualized environment with 100+ VM´s can impact on your storage system quite seriously if all VM´s start to defrag at the same time. One way to mitigate this is to set the start day and start time different on all machines.