Discussion:
The directory property cannot be found in the Cache
(too old to reply)
Bart Steur
2005-05-03 11:37:54 UTC
Permalink
Hello,

I want to see an users logon and logoff times in a VB6 program. I can see
LastLogon, but when I want to see the LastLogoff
property I get the message: 'The directory property cannot be found in the
cache'. And this also goes for al lot of other properties I like to use. How
can I get to them.

Thanks,

Bart
Torgeir Bakken (MVP)
2005-05-03 14:45:32 UTC
Permalink
Post by Bart Steur
Hello,
I want to see an users logon and logoff times in a VB6 program. I can see
LastLogon, but when I want to see the LastLogoff
property I get the message: 'The directory property cannot be found in the
cache'. And this also goes for al lot of other properties I like to use. How
can I get to them.
Hi,

Note that the LastLogin/LastLogon property is not replicated, so if
you have several domain controllers, you will need to connect to all
of them and compare the the LastLogon property. More here:

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


And when it comes to the lastlogoff property, you can just forget about
it:


From: ***@online.microsoft.com (Max L. Vaughn [MSFT])
Date: Tue, 16 Sep 2003 18:02:22 GMT
Subject: RE: lastLogoff
Message-ID: <***@cpmsftngxa07.phx.gbl>
Newsgroups: microsoft.public.adsi.general

<quote>

Windows OS's do not really care when you logoff, so the attribute is
not updated.

Crendentials are presented each time an action is performed on the
domain. To answer your questions, lastlogoff is not going to
accurately maintained if at all.

Sincerely,
Max Vaughn [MS]
Microsoft Developer Support

</quote>
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Bart Steur
2005-05-03 14:55:27 UTC
Permalink
Ok, so I can't get an accurate lastlogon, but how about all other properties
in the IADUser object. Lots of them also have The directory property cannot
be found in the cache'.
Post by Torgeir Bakken (MVP)
Post by Bart Steur
Hello,
I want to see an users logon and logoff times in a VB6 program. I can see
LastLogon, but when I want to see the LastLogoff
property I get the message: 'The directory property cannot be found in
the cache'. And this also goes for al lot of other properties I like to
use. How can I get to them.
Hi,
Note that the LastLogin/LastLogon property is not replicated, so if
you have several domain controllers, you will need to connect to all
Last Logon Dates
http://www.rlmueller.net/Last%20Logon.htm
And when it comes to the lastlogoff property, you can just forget about
Date: Tue, 16 Sep 2003 18:02:22 GMT
Subject: RE: lastLogoff
Newsgroups: microsoft.public.adsi.general
<quote>
Windows OS's do not really care when you logoff, so the attribute is
not updated.
Crendentials are presented each time an action is performed on the
domain. To answer your questions, lastlogoff is not going to
accurately maintained if at all.
Sincerely,
Max Vaughn [MS]
Microsoft Developer Support
</quote>
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
http://www.microsoft.com/technet/scriptcenter/default.mspx
Marc Scheuner [MVP ADSI]
2005-05-04 06:00:03 UTC
Permalink
Post by Bart Steur
Ok, so I can't get an accurate lastlogon, but how about all other properties
in the IADUser object. Lots of them also have The directory property cannot
be found in the cache'.
That just means there has been no value set for that property (yet) -
it doesn't contain a value yet.

Marc
________________________________________________________________
Marc Scheuner ** mscheuner -at- mvps.org ** http://adsi.mvps.org
Microsoft MVP for Directory Services Programming
http://www.dirteam.com/blogs/mscheuner/default.aspx
http://groups.yahoo.com/group/ADSIANDDirectoryServices/
Bart Steur
2005-05-04 06:37:07 UTC
Permalink
When I look at the User Properties in the Active Directory Users and
Computers, fields like First Name, Last Name, Telephone Number, Title, etc.
are correctly filled.
Also when I look more closely, not all fields in the IADUser object match
the fields in the User Properties of AD Users and Computers. (ie.
Street/City vs Postal Addresses/Codes).
Maybe there is another way to query these AD properties?
Post by Marc Scheuner [MVP ADSI]
Post by Bart Steur
Ok, so I can't get an accurate lastlogon, but how about all other properties
in the IADUser object. Lots of them also have The directory property cannot
be found in the cache'.
That just means there has been no value set for that property (yet) -
it doesn't contain a value yet.
Marc
________________________________________________________________
Marc Scheuner ** mscheuner -at- mvps.org ** http://adsi.mvps.org
Microsoft MVP for Directory Services Programming
http://www.dirteam.com/blogs/mscheuner/default.aspx
http://groups.yahoo.com/group/ADSIANDDirectoryServices/
Marc Scheuner [MVP ADSI]
2005-05-05 09:58:08 UTC
Permalink
Post by Bart Steur
When I look at the User Properties in the Active Directory Users and
Computers, fields like First Name, Last Name, Telephone Number, Title, etc.
are correctly filled.
Also when I look more closely, not all fields in the IADUser object match
the fields in the User Properties of AD Users and Computers. (ie.
Street/City vs Postal Addresses/Codes).
Maybe there is another way to query these AD properties?
Are you SURE you're looking at the right properties? The actual
IADsUser properties and their names ARE NOT identical with the LDAP
attribute names! E.g. IADsUser.FullName does *NOT* exist in LDAP as
"FullName" - it's really "displayName" !

Check out Richard Mueller's excellent reference about what LDAP
properties the ADU&C fields map to:

http://www.rlmueller.net/UserAttributes.htm

Richard has a spreadsheet of User Properties in ADU&C and what LDAP
properties they refer to.

Once you've successfully bound to the user object, and provided you're
using the right LDAP attribute name, you should be able to retrieve
all attribute values (*IF* they are set!). No special magical tricks
needed.......

Marc

Continue reading on narkive:
Loading...