Discussion:
Lastlogon attribure and performance
(too old to reply)
Jesper Ravn
2009-11-10 11:52:09 UTC
Permalink
Hello

I have created a small application in VB.net where I query AD information.
In the user section I can retrive LastLogon, by query all DC.
My main concern though, is the performance when I list 3000-5000+ users in a
listview.
What is your experience with LastLogon and performance where the enviroment
host mutiple Domain Controlleres in branch office
Should I go down that road or should I pull the LastLogon value from a basic
inventory (Logon script + SQL).
Im already using the LastlogontimeStamp to determine old users and
computers, but the lastlogon attribute, are more up to date and are often
requeted by helpdesk staff.

Thanks,

/Jesper
Richard Mueller [MVP]
2009-11-10 16:20:40 UTC
Permalink
Post by Jesper Ravn
Hello
I have created a small application in VB.net where I query AD information.
In the user section I can retrive LastLogon, by query all DC.
My main concern though, is the performance when I list 3000-5000+ users in
a listview.
What is your experience with LastLogon and performance where the
enviroment host mutiple Domain Controlleres in branch office
Should I go down that road or should I pull the LastLogon value from a
basic inventory (Logon script + SQL).
Im already using the LastlogontimeStamp to determine old users and
computers, but the lastlogon attribute, are more up to date and are often
requeted by helpdesk staff.
3000-5000 users is not a lot, unless you are binding to the user objects. I
use ADO to query the DC's for all users in bulk (you must turn on paging).
The number of DC's and the speed of the links is more important. I retain
the largest lastLogon value for each user in a dictionary object. Again,
5000 entries is not a lot, and a dictionary object should be more efficient
than an array. The query for lastLogon should be separate from the query for
other attributes that are replicated.

A VBScript example is linked here:

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

I've done similar in classic VB. I added a reference to the Microsoft
Scripting Runtime (scrrun.dll) for the dictionary object, and another for
Microsoft ActiveX Data Objects. I haven't done it in VB.NET.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Jesper Ravn
2009-11-11 14:39:56 UTC
Permalink
Post by Richard Mueller [MVP]
Post by Jesper Ravn
Hello
I have created a small application in VB.net where I query AD
information.
In the user section I can retrive LastLogon, by query all DC.
My main concern though, is the performance when I list 3000-5000+ users
in a listview.
What is your experience with LastLogon and performance where the
enviroment host mutiple Domain Controlleres in branch office
Should I go down that road or should I pull the LastLogon value from a
basic inventory (Logon script + SQL).
Im already using the LastlogontimeStamp to determine old users and
computers, but the lastlogon attribute, are more up to date and are often
requeted by helpdesk staff.
3000-5000 users is not a lot, unless you are binding to the user objects.
I use ADO to query the DC's for all users in bulk (you must turn on
paging). The number of DC's and the speed of the links is more important.
I retain the largest lastLogon value for each user in a dictionary object.
Again, 5000 entries is not a lot, and a dictionary object should be more
efficient than an array. The query for lastLogon should be separate from
the query for other attributes that are replicated.
http://www.rlmueller.net/Last%20Logon.htm
I've done similar in classic VB. I added a reference to the Microsoft
Scripting Runtime (scrrun.dll) for the dictionary object, and another for
Microsoft ActiveX Data Objects. I haven't done it in VB.NET.
Hi Richard

Ok, I will give it a try.
I found the link below which is the .NET way to do it.
http://www.codeproject.com/KB/security/LastLogonAcrossAllWindows.aspx

There is also a reference to your script. Thanks again.

/Jesper

Loading...