It seems (from errors I am getting) that the SearchResult class
in retrieving Property Names from the AD stores them ignoring the case
they were originally in (they are stored in lower case). Is there
anyway to copy the Property Names retaining their case?
Code I am using is below (it is the variable 'myKey' that returns
the Property Name that is always lower case, irrespective of what it is
in the AD)
1 foreach(SearchResult result in mySearcher.FindAll())
2 {
3 ResultPropertyCollection myResultPropColl;
4 myResultPropColl = result.Properties;
5
6 // Loop through Group Properties expoprting data
7 foreach( string myKey in myResultPropColl.PropertyNames)
8 {
9
10 foreach( Object myCollection in myResultPropColl[myKey])
11 {
12 tw.Write(myKey + ": " + myCollection);
13 .
14
15 .
16
17
So in finding the Property Name "dateOfBirth" in the AD, it is actually returned as "dateofbirth" causing the below case statement to be ignored:
1 switch (fieldname)
2 {
3 case "dateOfBirth:": .
The search code (as listed first) is acutally a seperate Project, with the 'Switch' statement being only one of many (for digfferent objects in the AD) in a different project that at this stage I cant really modify. So I was hoping there was some way I could ensure what is returned from the AD is in the correct case.