Click here to Skip to main content
15,881,516 members
Articles / Desktop Programming / MFC
Article

Getting Logon times for users on a Domain/Computer

Rate me:
Please Sign up or sign in to vote.
1.89/5 (7 votes)
28 Feb 20051 min read 52.6K   1.4K   14   2
An article on getting user logon times for a specific domain or computer

Introduction

This article shows the easiest way of enumerating users for a domain or a specific machine using the standard ADSI calls. During enumeration, it gets the users generic information like Description, login id, etc. and the last logon time. The only API used in the entire code is GetComputerName, that too because the user might feel leaving the text box empty to enumerate users on the local machine.

Using the code

The code is written in vanilla VB and is very easy to understand. Please refer to msdn.microsoft.com for ADSI. The code is implemented into a single form which:

1. Enumerates the users on a specific domain/computer

2. Emits generic information and last logon information for the user to a CSV file (logons.csv)

3. Shows progress during the entire process

Points of Interest

I spent a lot of time on the net to search for something which achieves this. However most of the locations just gave me information for network API calls like NetUserEnum, etc. Which are great if you use C/C++, but are very troublesome if you plan to use them in VB. This articles shows you how easy it is to achieve all of this using ADSI.

History

Version: Original Version 1.0
Author: Parag Paithankar
Release date: 1-Mar-2005.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Japan Japan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
Dave Kreskowiak11-Jan-10 9:47
mveDave Kreskowiak11-Jan-10 9:47 
QuestionOne user information Pin
jx2ang28-Aug-06 5:40
jx2ang28-Aug-06 5:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.