Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

SCOM 2007 R2 added a fragmentation analsysis health check that is producing warnings on many of my servers. To try to understand how SCOM is determines the fragmentation level, I created the following Powershell script that reproduces the same data:

$vols = Get-WmiObject -computername "Z002" Win32_Volume -filter "DriveType=3"
$defragInfo = $vols | %{$_.DefragAnalysis() | add-member -membertype noteproperty vname $ -passThru}
$defragInfo | %{$_.DefragAnalysis | add-member -membertype noteproperty DefragRecommended $_.DefragRecommended -passThru | add-member -membertype noteproperty vname $_.vname -passThru} | out-file ./tmp.txt

Sample output below. SCOM uses the FilePercentFragmentation number to warn on anything over 10%, what I'm wondering is how is the percentage calculated since it certainly isn't fragmented files divided by total files.

DefragRecommended : True

vname : I:\

AverageFileSize : 20277223990

AverageFragmentsPerFile : 1.11

ClusterSize : 4096

ExcessFolderFragments : 0

FilePercentFragmentation : 54

FragmentedFolders : 1

FreeSpace : 131237363712

FreeSpacePercent : 24

FreeSpacePercentFragmentation : 0

MFTPercentInUse : 10

MFTRecordCount : 65

PageFileSize : 0

TotalExcessFragments : 4

TotalFiles : 35

TotalFolders : 14

TotalFragmentedFiles : 2

TotalMFTFragments : 2

TotalMFTSize : 606208

TotalPageFileFragments : 0

TotalPercentFragmentation : 27

UsedSpace : 405626204160

VolumeName :

VolumeSize : 53686356787

share|improve this question
By the way, I like your Powershell script. I'm going to pinch it. – user3914 Oct 14 '09 at 11:18
thanks, go for it! – Chad Miller Oct 15 '09 at 1:13
up vote 1 down vote accepted

I'm making an educated guess here, but I think it has to do with average fragmented file size (e.g. how many files are fragmented vs not), and their size as a percentage of total files.

For example, on one of my production servers, I have 0% fragmentation for all files bar one, which happens to be the database MDF file. The 60GB file is in two fragments, but the total fragmentation report states 73%.

Hope that makes sense.

share|improve this answer
I think that's a good guess and a likely explaination -- thanks – Chad Miller Oct 14 '09 at 12:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.