' --------------------------------------------------------------------------------------- ' Author: Marcus C. Oh ' Date: 05/01/2006 ' Purpose: Changes registry key on MOM agents to resolve GUID from security events. ' Version: 1.0 ' --------------------------------------------------------------------------------------- Const HKLM = &H80000002 sServerName = "." ' Set strings sKeyPath = "Software\Mission Critical Software\OnePoint" sKeyName = "ServiceVersion" ' Check MOM Agent version Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ sServerName & "\root\default:StdRegProv") oRegistry.GetStringValue HKLM, sKeyPath, sKeyName, sKeyValue If IsNull(sKeyValue) Then ' If the default location is empty, then check the legacy location sKeyName = "VersionNumber" oRegistry.GetStringValue HKLM, sKeyPath & "\Operations", sKeyName, sKeyValue If IsNull(sKeyValue) Then ' If legacy is also empty, exit script. ScriptContext.Quit Else oRegistry.EnumKey HKLM, sKeyPath, aConfigGroups For Each ConfigGroup In aConfigGroups RunKeyMod sKeyPath & "\Configurations\" & ConfigGroup & "\Operations\Agent" Next End If Else RunKeyMod sKeyPath End If Sub RunKeyMod(sKeyPath) sKeyName = "ResolveGUID" sKeyValue = "1" oRegistry.SetDWORDValue HKLM, sKeyPath, sKeyName, sKeyValue End Sub