Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript For Last Login x Day Ago for NT Domain

Status
Not open for further replies.

Bcolvin

Technical User
Sep 23, 2003
10
0
0
I found a copy of a script that would generate a report of which NT accounts hadn't logged in for x amount of days, but I've now lost it. Does anyone have a script that can generate a report like this? We're on an NT 4.0 domain.

Thanks.
 
i seem to recall posting something about it, do a search on this forum for .LastLogin property

the trcik with the lastlogin property is that you need to check against each DC for the users .lastlogin property @(if i recall correctly) as each DC holds a value. so it all depends on which was the last DC that validated the user.

so, get a list of all the users then bind to each one with

Set oUser = GetObject("WinNT://" & domainordcname & "/" & username & ",user")

Then grab the value

oUser.LastLogin

I would create a dictionary object for each user and update the the value depending on the result of the the previous DC value, if you get my drift.

as i said i think i posted the full code required to do it a different way, using adsi instead, so i dont know what i am wittling on about really :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top