Windows Server IoT 2022

Koh Jun Hao 0 Reputation points
2026-09-02T01:50:36.3833333+00:00

Machine build:

  1. Fujitsu PRIMERGY TX1320 M5
  2. Server installed Window Server IoT 2022 STD
  3. Version 21H2, 20348.2461

We were advised that manually defragmenting the PC could cause more harm than good and that we should rely on Windows automatic defragmentation. However, the automatic defragmentation does not appear to be running on the server, which is using HDDs. We tested running defragmentation through Task Scheduler, and the task completed successfully.

 Could you please clarify the following:

  1. When defragmentation is triggered through Task Scheduler, does it perform a full defragmentation?
  2. Is it recommended and safe to configure Task Scheduler to run defragmentation automatically on HDDs?
  3. Why might the default automatic defragmentation not be running?
Windows for business | Windows for IoT
0 comments No comments

1 answer

Sort by: Most helpful
  1. Domic Vo 31,575 Reputation points Independent Advisor
    2026-09-02T02:54:44.9133333+00:00

    Hello,

    when you trigger defragmentation through Task Scheduler, it runs the same optimization routine that Windows uses for its scheduled maintenance. That means it performs a full defragmentation pass on HDD volumes, not just a superficial check. The difference is that the scheduled task is time‑based and runs weekly by default, whereas a manual trigger simply forces it to run immediately.

    It is safe and recommended to configure Task Scheduler to run defragmentation automatically on HDDs. Microsoft’s design is that the built‑in “ScheduledDefrag” task under \Microsoft\Windows\Defrag handles this weekly without user intervention. On servers with mechanical disks, enabling or customizing this task is the supported way to keep fragmentation under control.

    If the default automatic defragmentation is not running, the most common reasons are that the ScheduledDefrag task has been disabled, the system was not idle or powered on at the scheduled time, or the drive type was misidentified. In some cases, if the disk is flagged incorrectly as SSD, Windows will apply TRIM instead of defragmentation. You can confirm by opening Task Scheduler, navigating to \Microsoft\Windows\Defrag, and checking the status of the “ScheduledDefrag” task. Ensuring it is enabled and set to run weekly will restore the automatic behavior.

    I hope you've found something useful here. If it helps you get more insight into the issue, it's appreciated to accept the answer. Should you have more questions, feel free to leave a message. Have a nice day!

    Domic Vo.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.