Click here to Skip to main content
Click here to Skip to main content
Go to top

Getting Logon times for users on a Domain/Computer

, 28 Feb 2005
Rate this:
Please Sign up or sign in to vote.
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

Share

About the Author

No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 PinmvpDave Kreskowiak11-Jan-10 9:47 
No explanation of the code nor the concepts behind it.
QuestionOne user information Pinmemberjx2ang28-Aug-06 5:40 

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

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

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 28 Feb 2005
Article Copyright 2005 by Parag Paithankar
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid