Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 trying to get \DBServer\SQLServer:Buffer Manager\Page life expectancy data through WMI. When I do this through perfmon, I get actual data. However when I try and pull this from either of these WMI classes(which I believe should be correct) it always returns 0: Win32_PerfFormattedData_MSSQLSERVER_SQLServerBufferManager Win32_PerfRawData_MSSQLSERVER_SQLServerBufferManager

Using WMIExplorer it returns 0's across all columns in both WMI classes.

The PerfLog has data: "07/08/2010 12:02:53.986","4429"
"07/08/2010 12:03:08.989","4429"
"07/08/2010 12:03:23.991","4429"
"07/08/2010 12:03:38.994","4429"
"07/08/2010 12:03:53.996","3415"
"07/08/2010 12:04:08.999","3415"
"07/08/2010 12:04:24.001","3415"

Where else would this data be stored so that I could get it through WMI?

share|improve this question

You don't say what property you are calling on for the WMI classes. The PageLifeExpectancy property should have the same data as Perfmon. Try this vbscript:

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

strComputer = "SQLSERVER"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PerfFormattedData_MSSQLSERVER_SQLServerBufferManager", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
    WScript.Echo "Pagelifeexpectancy: " & objItem.Pagelifeexpectancy

(edit) Sorry, you actually do say that all columns return zero. Try the script anyway, just in case you are doing something different. I have tested it on an SQL Server 2008 machine and it gives the same data as Perfmon.

share|improve this answer

Your Answer


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