Dear LotusScript Gurus,
I am developing a Lotus Notes agent who should synch our Windows 2003 AD with our Lotus Domino Directory (V 7.0.3 Server/Client).
I am using the ADODB.Connection and ADODB.Command processes to connect it and query the AD users.
This is the command text:
objCommand.CommandText = "<LDAP://ou=DMHU Users,dc=some,dc=kindof,dc=domain>;(&(objectCategory=person)(objectClass=user));name,lastLogon;subTree"
Then I would access the content of the field “lastLogon”:
objRecordSet.Fields("lastLogon").Value
but this is empty while the field “name” has the correct values (I know that the lastLogon field is a 64bit date – integer or so).
Using the same query e.g. in a VBScript receives the lastLogon content well.
Also using the SQL like query within the LotusScript code gives the same empty lastLogon value.
Does anybody have an idea?
Thanks in advance!
Finally I have found the solution.
To access the lastLogon (and so kind AD variables) first of all an object has to be set which receives the current AD user object:
then the lastLogon has to be set as an object, as well:
This OLE object will have a HighPart and a LowPart member. Using that members the last logon date and time can be calculated.
This blog entry opened my eyes:
http://sgwindowsgroup.org/blogs/badz/archive/2010/03/01/querying-for-the-lastlogontimestamp-attribute-of-all-users-in-an-ou.aspx
Here is the function implemented by me which can receive the CN and lastLogonTimeStamp of a specific user.