Thanks Mark that sent me in the right direction this is what I used (I collect the value for the variable d1 from the user and save the formated date as d2)
Thanks again.Code:' Loop process until all database records that meet criteria have been read (End of File) Do Until objRecordSet.EOF ' Assign the variable strComputer the name of the windows 2003 server each pass of the loop strComputer = objRecordSet.Fields("Name").Value intSrvCount = intSrvCount + 1 Set objSession = CreateObject("Microsoft.Update.Session", strComputer) Set objSearcher = objSession.CreateUpdateSearcher intHistoryCount = objSearcher.GetTotalHistoryCount Set colHistory = objSearcher.QueryHistory(1, intHistoryCount) objNewFile.WriteLine "Server Number: " & "," & intSrvCount objNewFile.WriteLine "Server Name: " & "," & strComputer For Each objEntry in colHistory d3 = FormatDateTime(objEntry.Date,2) If d3 = d2 Then objNewFile.WriteLine "Operation: " & objEntry.Operation objNewFile.WriteLine "Result code: " & objEntry.ResultCode objNewFile.WriteLine "Exception: " & objEntry.Exception objNewFile.WriteLine "Date: " & objEntry.Date objNewFile.WriteLine "Title: " & objEntry.Title objNewFile.WriteLine "Description: " & objEntry.Description objNewFile.WriteLine "Unmapped exception: " & objEntry.UnmappedException objNewFile.WriteLine "Client application ID: " & objEntry.ClientApplicationID objNewFile.WriteLine "Server selection: " & objEntry.ServerSelection objNewFile.WriteLine "Service ID: " & objEntry.ServiceID i = 1 For Each strStep in objEntry.UninstallationSteps objNewFile.WriteLine i & " -- " & strStep i = i + 1 Next objNewFile.WriteLine "Uninstallation notes: " & objEntry.UninstallationNotes objNewFile.WriteLine "Support URL: " & objEntry.SupportURL objNewFile.WriteLine End If Next objRecordSet.MoveNext Loop




Reply With Quote