473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 1634
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.googlegr oups.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
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...
7
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...
1
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...
2
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...
1
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...
0
by: gewe | last post by:
Can anyone tell me what is wrong with the following code? The code has to watch for logon/logoff events: public void StartListenLogon() { EventHandler handler = new EventHandler();...
0
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...
2
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...
1
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...
2
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 ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.