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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADSI View by lastlogin

Status
Not open for further replies.
May 8, 2004
92
0
0
GB
Hi guys,

Dont know why but having serious problems while i want to display accounts that havent logged in before or on the specified date.this is what i am doing

For Each Member in Domain
If Member.Class ="user" AND Member.LastLogin=Mydate
Then
Response.write Member.Name &"<BR>"
End If
Next
Any ideas cheers
 
What is happening, are any users being displayed? Also, shouldnt Member.LastLogin <= Mydate, and not just =?
 
Yuh but iam testing with = for now okay this is whats happening....

Member.LastLogin returns Date & TIME ....so the thing is if time is also specified user would get displayed :(

so basically i need to specify both time and date...any alternative??
 
okay this is what ive done but problem still not sovled i think now i need to play around with dates


i did this
SplitDate = Split(member.LastLogin)

and got the time out now i can use

If SplitDate(0) ="03/29/2005" Then
now the problem comes if i do
If SplitDate(0) <="04/27/2005" Then as the splitdate is not a date and a string??? what can i do to make it a date?
 
And this ?
If CDate(SplitDate(0)) <= CDate("04/27/2005") Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
yuh did this

ConvertDate = SplitDate(0)
ConvertDate = CDate(ConvertDate)
 
Here is a link for a script that works great to do what you are looking for. If you don't want to use it, you can at least see how to read the dates which are more tricky than you think because of the way the info is recorded in AD. It is not just a date field.


I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top