I am trying to load the physicalDeliveryOfficeName attribute from the DirectoryEntry returned by the GetUnderlyingObject method as a UserPrincipal for example:
DirectoryEntry directoryEntry = principal.GetUnderlyingObject() as DirectoryEntry;
This means that the following statement returns false:
directoryEntry.Properties.Contains("physicalDeliveryOfficeName");
I know that this property can be loaded by adding a name to StringCollection DirectorySearcher.PropertiesToLoad when using the specified DirectorySearcher .
My questions are: why does the DirectoryEntry returned by the GetUnderlyingObject method contain all the properties? And how can I load this property without using DirectorySearcher ?
DΓ€nu source share