|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Question about DirectoryEntryI had a small doubt about the working of DirectoryEntry. I create a DirectorySearcher and search for a particular user on my domain using ds.Filter = "sAMAccountName="+username; Then using SearchResult.GetDirectoryEntry() I get a DirectoryEntry object representing the user, say de. The question is: Does the DirectoryEntry.Properties collection prefetch the properties/attributes of the user, that are defined at Active Directory. or is it that when I use de.Properties["xyz"], the value is queried against Active Directory resulting in a network call. I think it does prefetch since while debugging I can see the property count as 35, but I want to be sure. In addition, how is this related to caching of the attribute values, specifically, the RefreshCache etc. methods. Thanks in advance Vikas Manghani >Does the DirectoryEntry.Properties collection prefetch the When you first access the .Properties collection, most of the>properties/attributes of the user, that are defined at Active Directory. >or is it that when I use de.Properties["xyz"], the value is queried against >Active Directory resulting in a network call. attributes will be fetched for you. That's basically the behaviour of the underlying ADSI .Get() call. You *CAN* however specify to get only certain attributes, if you call the .RefreshCache method on the DirectoryEntry and specify a list of attributes to grab from the store into the properties cache. Also, there are some more complex attributes that are only fetched / evaluated when you specifically ask for that. Those need to be explicitely requested by calling .RefreshCache with their attribute name (things like 'tokenGroups' and others). HTH Marc |
|||||||||||||||||||||||