Cannot WMI Query root\MSCluster namespace as Local Admin

clusterwindows-server-2008windows-server-2008-r2wmi

I'm trying to use WMI Explorer to query the root\MSCluster namespace on various hosts to obtain cluster resource group and resource object data. I can access the namespace with no issue on Win2K3 cluster nodes but am getting an access denied error attempting to connect to Win2K8 and Win2K8R2 nodes.

I can access the root\cimv2 namespace with no issue, just the MSCluster namespace even though I am a local Admin. Is there a feature setting, local security policy or server role I have to be a member of to access the namespace?

Best Answer

Not familiar with WMI Explorer, but does it let you specify the ImpersonationLevel?

Try the folling VBScript (not tested) on the local machine. Then edit the strComputer = "." line to be the server name and execute remotely:

On Error Resume Next

Dim strComputer
Dim objWMIService
Dim colClusterNodes
Dim objClusterNode

strComputer = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\" & strComputer & "\root\mscluster")
If Err.Number <> 0 Then
    WScript.Echo "ERROR : Failed to get WMI handle [" & Err.Description & "]"
    Err.Clear
Else

    Set colClusterNodes = objWMIService.ExecQuery( "Select * from MSCluster_Node")
    If Err.Number <> 0 Then
        WScript.Echo "ERROR : Failed to execute WMI query [" & Err.Description & "]"
        Err.Clear
    Else 

        For Each objClusterNode in colClusterNodes
            Wscript.Echo "Caption : " & objClusterNode.Caption
            Wscript.Echo "State   : " & objClusterNode.State
            Wscript.Echo "Status  : " & objClusterNode.Status
            WScript.Echo ""
    Next

        Set colClusterNodes = Nothing
    End If

    Set objWMIService = Nothing
End If