Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Serch remote event log

Posted on 2008-10-02
5
Medium Priority
?
340 Views
Last Modified: 2013-11-07
Hello,

I need to search the eventlog for a remote machine with specefied source.
 Then i need to read all logs to see if a logout exist after later than a logon.

IS this possible and is so, how?

Thanks,  
Peter
0
Comment
Question by:carnegieuk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:melmers
ID: 22622752
You must import system.Diagnostics

Dim myEventLogReader as new Eventlog("Application","MachineName")
For each myEntry as EventLogEntry in myEventLogReader.Entries
    Console.WriteLine(myEntry.Message)
Next
0
 

Author Comment

by:carnegieuk
ID: 22622863
OKey, so how can i read all entries and set online = "1" if we dont have any logoff after a logon?
0
 
LVL 11

Expert Comment

by:melmers
ID: 22622906
With the sourcecode you can read all log entries.
i don't know your code so you must post it here or explain me more about your software.

But i think it's not a good idea to use the eventlog to identify if a user is logged in or logged off because of deleteing the eventlog from the user side or an admin script.

0
 

Author Comment

by:carnegieuk
ID: 22623174
It's for monitoring a service, make sure it's logged on.

When the service log on to the system it writes a message in the eventlog containing logon when it logss out or if the connection dies it writes a message containing logout.

betwheen thes messages it can be a few hundred of entries.  

but i just realise that it's going to be to intens for the servers to run sutch a searc, it's a lot of eventlogs.

but maybe you can answear how to read eventlogs in realtime?
0
 
LVL 11

Accepted Solution

by:
melmers earned 1500 total points
ID: 22623546
When the software runs on the server itself and not on a remote one then you can use
the event EbntryWritten form the Eventlog Class.

This event is only fired when the software runs on the local server and is not connected to
a remote server.

You can also read the log and use the .EntryWritten property of an EventLogEntry Object
if the entrywritten timestamp is lower than yor last read then you can skip the entry
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question