troubleshooting Question

Vb.Net - querying event log (system) entries

Avatar of sirbounty
sirbountyFlag for United States of America asked on
.NET ProgrammingVisual Basic.NET
3 Comments1 Solution793 ViewsLast Modified:
Hi - I'm trying to pull information related to hotfix installations on my devices.
I'm using 2005 to read the remote logs, but am not finding an easy way to filter it properly, and it's taking to long to iterate the entire log collection and pull back just what I need...

I ordinarily only need log entries for 'today' that have a source of NtServicePack (eid 4377 seems to be the eventid, but I do get a warning in my code to use instanceID which isn't showing the same value).

I simply want to pull back if the hotfix was properly applied or not...
Any ideas on how I can further narrow this, or somehow speed up my query?

(If it helps - I could also filter by username, because normally only one user would be doing the installation)
Using elEvent As New EventLog("System", strComputer, "NtServicePack")
  Dim elEvtCol As EventLogEntryCollection = elEvent.Entries
            For x As Int32 = elEvtCol.Count - 1 To minRecordsToReturn Step -1

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros