strTargetComputer = WScript.Arguments.Item(0) strMOMServer="MON-MGT-01" wscript.echo strTargetComputer 'Get the computer that logged the event Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strMOMServer & "\root\MOM") Set objEnumerator = objWMI.ExecQuery("select * from MSFT_Computer where name='"& strTargetComputer & "'") 'Assign it's GUID to a variable For Each CompProp In objEnumerator strComputerGUID = CompProp.GUID Exit For Next 'Find all the alerts associated with that computer GUID strQuery = "ASSOCIATORS OF {MSFT_Computer.GUID=""" & strComputerGUID & """} WHERE ResultClass=MSFT_Alert" Set objComputerAlerts = objWMI.ExecQuery(strQuery) Set GetAlertsForComputer = objComputerAlerts 'Resolve the alert For Each Alert In GetAlertsForComputer If Alert.ResolutionState <> 255 Then If Len(Trim(Alert.AlertHistoryComment)) = 0 Then Alert.AlertHistoryComment = Null If Len(Trim(Alert.CustomField1)) = 0 Then Alert.CustomField1 = Null If Len(Trim(Alert.CustomField2)) = 0 Then Alert.CustomField2 = Null If Len(Trim(Alert.CustomField3)) = 0 Then Alert.CustomField3 = Null If Len(Trim(Alert.CustomField4)) = 0 Then Alert.CustomField4 = Null If Len(Trim(Alert.CustomField5)) = 0 Then Alert.CustomField5 = Null If Len(Trim(Alert.Description)) = 0 Then Alert.Description = Null If Len(Trim(Alert.OwnerName)) = 0 Then Alert.OwnerName = Null If Len(Trim(Alert.ResolvedBy)) = 0 Then Alert.ResolvedBy = Null If Len(Trim(Alert.TimeResolved)) = 0 Then Alert.TimeResolved = Null Alert.ResolutionState = 255 Alert.Put_ End If Next