We help IT Professionals succeed at work.
Get Started

Vb.Net - querying event log (system) entries

Last Modified: 2013-11-07
Hi - I'm trying to pull information related to hotfix installations on my devices.
I'm using vb.net 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

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE