''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Find Missing Cluster Resources ' ' ' ' Author: Mike McGuire (mike@mikejmcguire.com) ' ' Updated: 30 OCT 2013 ' ' ' ' Load a copy of CLUSDB to the following registry ' ' location: HKEY_LOCAL_MACHINE\Cluster ' ' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''' Option Explicit Const HKEY_LOCAL_MACHINE = &H80000002 Dim oRegistry, oResources Dim strResource, strResourceGroup, aResources, aResourceGroups Dim aKeys, aValues, aDefaultRoute, aValueTypes Dim strGroupsKey, strResourcesKey, strName, strType, aData Dim iIndex strGroupsKey = "Cluster\Groups" strResourcesKey = "Cluster\Resources" Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") Set oResources = CreateObject("Scripting.Dictionary") oRegistry.EnumKey HKEY_LOCAL_MACHINE, strResourcesKey, aResources For Each strResource In aResources WScript.Echo "Resource: " & strResource oRegistry.GetStringValue HKEY_LOCAL_MACHINE, strResourcesKey & "\" & strResource, "Name", strName WScript.Echo "- Name: " & strName oRegistry.GetStringValue HKEY_LOCAL_MACHINE, strResourcesKey & "\" & strResource, "Type", strType WScript.Echo "- Type: " & strType oResources(strResource) = strName & " (" & strType & ")" WScript.Echo Next oRegistry.EnumKey HKEY_LOCAL_MACHINE, strGroupsKey, aResourceGroups For Each strResourceGroup In aResourceGroups WScript.Echo "Resource Group: " & strResourceGroup oRegistry.GetStringValue HKEY_LOCAL_MACHINE, strGroupsKey & "\" & strResourceGroup, "Name", strName WScript.Echo "- Name: " & strName If oRegistry.GetMultiStringValue(HKEY_LOCAL_MACHINE, strGroupsKey & "\" & strResourceGroup, "Contains", aData) = 0 Then For iIndex = LBound(aData) To UBound(aData) If oResources.Exists(aData(iIndex)) Then WScript.Echo "- Resource: " & oResources(aData(iIndex)) Else WScript.Echo "- Resource (**Missing**): " & aData(iIndex) End If Next End If WScript.Echo Next Set oRegistry = Nothing Set oResources = Nothing