You can do this with VBScript/ADSI.  You will have to inquire with each
domain controller and take the highest value.  The very base code is:

Dim lobjUser, lstrLogons
Set lobjUser = GetObject("WinNT://DomainController1/TheUserName &
",User")
lstrLogons = lstrLogons & "DomainController1 last logon: " &
lobjUser.LastLogin & vbNewLine
Set lobjUser = GetObject("WinNT://DomainController2/TheUserName &
",User")
lstrLogons = lstrLogons & "DomainController2 last logon: " &
lobjUser.LastLogin & vbNewLine
MsgBox lstrLogons 

-----Original Message-----
From: Joseph Heaton [mailto:jhea...@dfg.ca.gov] 
Sent: Tuesday, November 02, 2010 2:23 PM
To: NT System Admin Issues
Subject: User last login info

I have a Server 2003 DC, and a Server 2008 DC (not R2)


I've found some Powershell stuff that uses the AD module, but all I can
find references R2.  Is there a way to get that module for 2008, not R2?
Or is there another way of getting the info I'm looking for easily?


What I'm trying to find is the last login time for a user, to find out
if the account is needed anymore.  Doing it one-by-one would be fine, as
that's how I'm doing the first step of this process.

I am a Powershell noob, but very willing, and desiring to learn more.


Thanks.



~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~
<http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here:
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to listmana...@lyris.sunbeltsoftware.com
with the body: unsubscribe ntsysadmin




~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to listmana...@lyris.sunbeltsoftware.com
with the body: unsubscribe ntsysadmin

Reply via email to