"Jesper Ravn" <jesper_r
...@hotmail.com> wrote in message
news:uLpj9wfYKHA.1648@TK2MSFTNGP05.phx.gbl...
> 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
--