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

I'm using WMI to monitor Windows Server 2003 and Windows Server 2008 hosts. I got all the info I wanted but the disk I/O performance.

I've tried quering the "Win32_PerfFormattedData_PerfDisk_LogicalDisk" for the "AvgDiskQueueLength", but I always get "no key" result.

The WMI service is running on both systems and I can connect to it using wbemtest without any errors.

Have I missed something or am I doing something wrong?

share|improve this question
SELECT AvgDiskQueueLength FROM win32_perfformatteddata_perfdisk_physicaldisk where name ='_Total' this above query always return 0 for AvgDiskQueueLength. Can any1 say how to get proper Disk usage – Satish R Mar 9 at 7:24
up vote 1 down vote accepted

AvgDiskQueueLength is a property of the Win32_PerfFormattedData_PerfDisk_LogicalDisk class. Unless the "no key" result is something really funky, it sounds like you maybe trying to access it wrong. It should be simple property notation like


The following code should work.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set objRefresher = CreateObject("WbemScripting.SWbemRefresher")
Set colDisks = objRefresher.AddEnum _
    (objWMIService, "win32_perfformatteddata_perfdisk_physicaldisk"). _
For Each objDisk in colDisks
        Wscript.Echo "Average Disk Queue Length: " & vbTab &  _

The refresher portion is really only needed if you're going to make multiple calls. Avoids having to execute the GetObject code over and over again.

You may want to research average disk queue length a bit though. I remember there being something funky about the way it's collected or reported. I might be wrong, but thought I'd mention it.

share|improve this answer
Thanks for the answer. The "no key" is the output of thw WQL query SELECT AvgDiskQueueLength FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk That code worked, but it always return 0. I've tried another properties with the same result, the only one that seems to return an actual value is the "Name" propertie. – Jorge Nov 8 '11 at 10:54
Yeah, that was one of the things I tend to remember about the average disk queue length. It really only shows up under extreme load. Not sure what type of load your current box is under. Are you accepting this answer or are you still looking for something else? – Jeffery Smith Nov 8 '11 at 13:28
I'll accept it. it already put me in a good track. Thanks – Jorge Nov 8 '11 at 13:40

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.