473,815 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading logon/logoff datetime

Hi.

I need to write a service that writes to a database the time of the
logon and logoff of the users. Our users logs on Active Directory and
some can also log as local administrators. The majority of the
workstations are Windows 2000 and some are Windows XP. I am reading
about WMI but have found some limitations when reading the WMI
structures, mainly with Windows 2000.

What is the best way to read logon/logoff information in this scenario?

Thanks,
Robert Scheer

Sep 19 '06 #1
2 1664
if you use .NET 2.0, you can use the Microsoft.Win32 .SystemEvents class and
register (and don't forget to unregister, because it's a static event) it's
SessionSwitch event.

http://msdn2.microsoft.com/en-us/lib...ionswitch.aspx

I hope it helps

ThunderMusic

"Robert Scheer" <rb******@my-deja.comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Hi.

I need to write a service that writes to a database the time of the
logon and logoff of the users. Our users logs on Active Directory and
some can also log as local administrators. The majority of the
workstations are Windows 2000 and some are Windows XP. I am reading
about WMI but have found some limitations when reading the WMI
structures, mainly with Windows 2000.

What is the best way to read logon/logoff information in this scenario?

Thanks,
Robert Scheer

Sep 19 '06 #2
Hello Robert,
The best way is to set up the domain accounts to cause an audit event on
logon/logoff. This would write an entry to the NT Event Log whenever someone
logs on or off.

-Boo
Hi.

I need to write a service that writes to a database the time of the
logon and logoff of the users. Our users logs on Active Directory and
some can also log as local administrators. The majority of the
workstations are Windows 2000 and some are Windows XP. I am reading
about WMI but have found some limitations when reading the WMI
structures, mainly with Windows 2000.

What is the best way to read logon/logoff information in this
scenario?

Thanks,
Robert Scheer

Sep 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
10588
by: jeff | last post by:
Hi. I am trying to read addresses from an Exchange 5.5 Global Address Book from an asp.net page. When the page executes the error "Collaboration Data Objects - ]" is generated. Here is the code: Dim strProfileInfo As String Dim ObjSession As New MAPI.Session
7
8197
by: Aarti | last post by:
I have written a windows service that needs to perform certain functions only if a User is logged in. The problem I am running into is that I get an error if the computer is in the process of being shut down or restarted. At all other times, the service runs just fine. I need to either detect a logon/logoff event OR check somehow as to whether there is currently a valid logged on user. The closest I have found is ManagementEventWatcher...
1
2984
by: Jonas | last post by:
Hi! I'm building an ASP.NET web application that needs an automatic logoff after a specified time out period, forcing the user to enter his/her Windows authentication credentials again. I use Windows authentication and IIS is set to use Basic Authentication as this is going to be used in an extranet/internet environment with IE as supported browser. Can I from server code logoff a user from the Windows domain, or do I have to...
2
3224
by: Raimund Taschler | last post by:
Hi all, I'm implementing a windows service (running with local system account) which has to do some tasks when users logon/logoff. How can the service register to those logon/logoff-events? I'm using .NET 1.1 and C# and the service will be installed on machines with os >= W2K. If you have any solution or hint tracking down this problem please let me know!
1
16757
by: hecsan07 | last post by:
Hey I am trying to read the Windows Event Logc. In fact, I am able to read the Event Log. My problem is that I am reading and filtering a large log and it takes a very very very very long time to complete. I am using the ordinary technique for reading/writing from and to the Event Log. I am wondering if there is a better way to speed things up. Below is an excerpt of the code I am using (notice that I am filtering by Category and...
0
3240
by: robpimentel | last post by:
Hi, I've been using DB2 for about 1 week, so please bear with me. DB2 Connect Enterprise Edition v8.1 FixPack 5 Windows Server 2003 Standard Edition SP1 Here is an error that continues to appear on our domain controllers (Security event log): Event Type: Failure Audit Event Source: Security
2
1669
by: Robert Scheer | last post by:
Hi. I need to write a service that writes to a database the time of the logon and logoff of the users. Our users logs on Active Directory and some can also log as local administrators. The majority of the workstations are Windows 2000 and some are Windows XP. I am reading about WMI but have found some limitations when reading the WMI structures, mainly with Windows 2000. What is the best way to read logon/logoff information in this...
1
2729
by: =?Utf-8?B?ZGpjYXNlbGV5?= | last post by:
I'm trying to write a service that will sit on the domain controller (or, if this proves to be impossible, to be rolled to all connecting Windows machines). It needs to get notification of each logon and logoff, capturing username & IP address. I've currently got a test application to check the inputs & outputs and the business logic is using EventLog_OnEntryWritten to trap 538's & 540's. Unfortunately (and peculiarly) a physical logon...
2
1863
by: Dan2kx | last post by:
Function LogonLog(OnOff As String) Dim rst As DAO.Recordset If OnOff = "On" Then Set rst = CurrentDb.OpenRecordset("tblLogonLog", dbOpenDynaset, dbAppendOnly) rst.AddNew rst!StaffID = LogStaffID rst!Logon = Now() rst.Update ElseIf OnOff = "Off" Then Set rst = CurrentDb.OpenRecordset("SELECT Max(tblLogonLog.LID) AS LID FROM tblLogonLog HAVING (((tblLogonLog.StaffID)=1) AND ((tblLogonLog.LogOff)...
0
10672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10408
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10427
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9225
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7687
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5710
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.