'Update custom fields on MOM Alerts ' 'Submitted by Anders Bengtsson ' 'Date: 10/16/2006 '=============================================== ' Get information from the alert '=============================================== Option Explicit Dim objAlert Dim strComputer If (ScriptContext.IsAlert()) Then Set objAlert = ScriptContext.Alert strComputer = objAlert.Computer Set objAlert = Nothing End If '=============================================== ' Query AD for information '=============================================== Dim strLocation Dim strDescription Dim objComputer Dim objProperty Set objComputer = GetObject _ ("LDAP://CN=" & strComputer & ",CN=Computers,DC=europe,DC=fabrikam,DC=net") objProperty = objComputer.Get("Location") If IsNull(objProperty) Then strLocation "The location has not been set." Else strLocation = objProperty objProperty = Null End If objProperty = objComputer.Get("Description") If IsNull(objProperty) Then strDescription = "The description has not been set." Else strDescription = objProperty objProperty = Null End If '=============================================== 'Update Custom Fields part '=============================================== Dim strRuleGroup If (ScriptContext.IsAlert()) Then Set objAlert = ScriptContext.Alert Call objAlert.SetCustomField (1,strLocation) Call objAlert.SetCustomField (2,strDescription) Call objAlert.SetCustomField (3,strComputer) End If