I am trying to get properties of users through the ADSI api. Some of our attributes in AD are not always filled, for example the employeeID (that gets added after a process is complete). I keep getting the following exception when I come across a user that doesn't have a value for employeeID: "The 'employeeID' property cannot be found in the cache.
I am loading a custom object through a LINQ query, so I can't catch the exception when I search for that property. Is there another method I should be using that returns null if the property doesn't exist (without throwing an exception)?