1

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?

Kiquenet
  • 143
  • 8
MZDBA
  • 133
  • 1
  • 6

1 Answers1

2

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
Simon Catlin
  • 5,222
  • 3
  • 16
  • 20
  • No apparant option to set it in WMI Explorer. I ran the script locally setting strComputer to the target server name and got an Error: Failed to Execute Query [Access Denied] error. I then RDP'd into the target, reverted back to "." and was getting the output for Caption and the other properties. – MZDBA Aug 30 '12 at 21:49
  • OK, that proves that WMI itself is OK, and that the MSCluster namespace is being exposed correctly (I've seen the WMI repository get corrupted so many times!). The issue you have is definitely security related (which you suspected already). I've modded the script above, and added "authenticationLevel=pktPrivacy", can you re-test? – Simon Catlin Sep 01 '12 at 15:42
  • Success! Setting AuthenticationLevel to PacketPrivacy did the trick. Thank you! – MZDBA Sep 07 '12 at 18:21
  • In ***Failover cluster***, only node is _active_, how-to `get the active node`? – Kiquenet Sep 24 '18 at 12:11