Hi,
I have a c## application that queries the AD and loads objectGuid as one of the properties. I would like to populate the data returned from active directory in a table [oracle database] with object guid as a key.
Couple of things I would like to know:
- what is the best datatype going to be of this field (storing objectGuid) value in oracle table?
- how do I retrieve the string value from objectguid?
As of now I am using following code to display samaccountname would like something in similar lines:
var
mySearcher = new DirectorySearcher(directoryEntry)
mySearcher.PropertiesToLoad.Add(
"samAccountName");
mySearcher.PropertiesToLoad.Add(
"objectGUID");
var
resultCollection = mySearcher.FindAll();
foreach
(System.DirectoryServices.SearchResult resEnt in resultCollection)
{
sw1.WriteLine(String.Format("{0}", resEnt.Properties["samaccountname"][0].ToString()));
}
Thanks
Kajal