?
Solved

c#, read user session from event log

Posted on 2014-04-11
10
Medium Priority
?
599 Views
Last Modified: 2014-06-03
Hi,

First, I am not sure if it is possible to get session information from event log of Windows. I am in need to read user session logs like when new user log in or log out.

Is it possible?

Thanks
0
Comment
Question by:josephm67
[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
10 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39994671
What "session information" are you looking for?
0
 

Author Comment

by:josephm67
ID: 39994714
I m looking for login and log out info of users
0
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 39994962
Do you want to create a new record on Windows Event Log when a user log in or log out?
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:josephm67
ID: 39994976
Yes, I need to grab it and then put it in database. Is it possible?
0
 
LVL 15

Assisted Solution

by:jorge_toriz
jorge_toriz earned 1332 total points
ID: 39994997
Yes, you can do that, but first I need to know if you are working on a desktop application or a web application?

Meanwhile I can give you the following code:

During log in process
System.Diagnostics.EventLog.WriteEntry("YourApp", "User USERNAME logged in");
DBStoreLogIn("USERNAME");

During log out process
System.Diagnostics.EventLog.WriteEntry("YourApp", "User USERNAME logged out");
DBStoreLogOut("USERNAME");
0
 

Author Comment

by:josephm67
ID: 39995209
It is desktop app. But, I want to grab the event. Is it possible to grab the event.

thanks
0
 
LVL 15

Assisted Solution

by:jorge_toriz
jorge_toriz earned 1332 total points
ID: 39995280
Event... what do you mean with "event"?, is there an event like "user_logged_in"? I can't depict the event you need to handle.

As far as I know you could write that pseudo-code in your authentication function, so you will be able to store the event on wherever you want.
0
 

Assisted Solution

by:josephm67
josephm67 earned 0 total points
ID: 39995341
What is authentication function?
You are talking about something else, I guess. I need to grad windows event when user log in to server or log out. Are you talking same?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 668 total points
ID: 39995392
Are you talking about Windows user login? This info is captured in the Security node of event viewer.
0
 

Author Closing Comment

by:josephm67
ID: 40108044
thanks
0

Featured Post

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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