Hi Koh Jun Hao,
The screenshots show that ScheduledDefrag completed successfully (Task Scheduler result 0x0). However, this only confirms that the scheduled task ran; it does not necessarily mean that a defragmentation operation was required or performed on every volume.
For further verification, please check:
- Event Viewer → Applications and Services Logs → Microsoft → Windows → Defrag → Operational. Make sure the Operational log is enabled; the normal Application/System logs may not contain the relevant events.
- Run
defrag C: /A /Vfrom an elevated Command Prompt to obtain the current fragmentation analysis. - Run
defrag C: /O /Vif you want to manually invoke the appropriate optimization for the drive and compare the result. - Check the ScheduledDefrag History and confirm the task action is still
%windir%\system32\defrag.exe -c -h -o -$.
The “Last analyzed or optimized” value in Optimize Drives should not be compared directly with Task Scheduler's Last Run Time, because the scheduled task can run successfully while Windows determines that a particular volume does not require optimization.
If the Defrag Operational log remains completely empty even after manually running defrag C: /A /V, please share the Windows Server IoT version/build (winver) and the output of that command. This will help determine whether the issue is only with the Optimize Drives UI/history or with the defragmentation service itself.