last account log on?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi-

I have a Windows 2000 domain. A few years back I used a command line tool
(not sure whether it was resource kit or support tools) that would give me
all the accounts in the domain and the last time they logged in. Can someone
tell me what that command is? Thanks!
 
Glen said:
I have a Windows 2000 domain. A few years back I used a command line tool
(not sure whether it was resource kit or support tools) that would give me
all the accounts in the domain and the last time they logged in. Can
someone
tell me what that command is? Thanks!

Hi,

Retrieving LastLogon dates in a Windows 2000 AD domain is not easy. I don't
remember a tool for this (unless Joe Richards has one). I have a VBScript
program that displays all users and their last logon dates. The output can
be redirected from a command prompt to a text file. The program is linked
here:

http://www.rlmueller.net/Last Logon.htm

Or, you might check out the OldCmp tool at:

http://www.joeware.net/win/free/index.htm
 
try this option

for /f "Skip=17 Tokens=1-5" %%a in ('net user "%username%" /domain') do
if /i "%%a"=="Last" if /i "%%b"=="logon" set dte=%%c
for /f "Skip=17 Tokens=1-5" %%a in ('net user "%username%" /domain') do
if /i "%%a"=="Last" if /i "%%b"=="logon" set tme=%%d
for /f "Skip=17 Tokens=1-5" %%a in ('net user "%username%" /domain') do
if /i "%%a"=="Last" if /i "%%b"=="logon" set tme2=%%e
echo last logon day was %dte% %tme% %tme2%

watch for text wrap. Each line starts with for /f
the last line starts with echo
This script will place the day, time and AM/PM into 3 variables (dte,
tme, tme2) that you can use however you want, including writing to a
text file.
example:
instead of echo last logon day was %dte% %tme% %tme2%
try:
echo %username% last logged on %dte% %tme% %tme2% >>c:\userlog.txt
 
Hi,

I believe the "net user" command contacts one Domain Controller, so only
retrieves the Last Logon date stored on that DC. This may not be the true
date, unless your domain is NT or you have one DC.
 
I have a script that will list out the users last logon as well as multiple
other attributes in a csv file. We run it in a sceduled task nightly and
keep them out put for SOX listings of users (Adds and Deletes)

Go to downloads at http://www.pbbergs.com/
Select Active Directory User Account Attributes

Attributes include:
a.. User Name
b.. Last Logon Date
c.. Creation Date
d.. Home Folder
e.. Script
f.. Display Name
g.. Password Not Needed
h.. Password Does Not Expire
i.. Expired Password
j.. Account Is Disabled

--


Paul Bergson MCT, MCSE, MCSA, CNE, CNA, CCA
http://www.pbbergs.com/

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Nothing from MS does this or at least does this correctly. You have to query
every account on every DC and then take the most recent date from each. You may
want to go look at Hyena which is a tool you can purchase to do this kind of work.

--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm
 
Hi Glen,

As posted above, there is nothing from MS that does this or at least
correctly. There are a few third party tools that will give you the
results you are looking for.
Active Directory Janitor allows you to choose among 35 properties when
scanning your network environment.
This tool allows you to scan user OR computer objects. It also allows
you to delete, disable, move and enable Active Directory accounts in
seconds.
You can find a trial version at the following links

http://www.specopssoft.com/products/ADJanitor/Default.asp

Best,
Harj Singh
"Power Your Active Directory Investment"
Special Operations Software
www.specopssoft.com
 
Back
Top