In my sample code for writing to update a value, say employeeId, i saw it said to use the properties method and follow two paths.

If it exists allready:

 then you would simply do:
child.Properties["EmployeeID"][0] = Id; // by the way it seems this has two be a two dimensional array as i get an error when i assume there is only one possible id and i can access with just one array index.

If it doesn't exist the field allready, then create it.


after which commit changes.

ok here is the issue. They say the field EmployeeId exists on all users, but the value is only on a fraction of them. My question is, does the field exist only on the users where the value has been set once, and not on users where the value never has been set, or does it exist on everyone and is just an empty value. I've tried to both write as if it exists and ignore my first logic ( contains) and that doesn't work.

When i try to add the field , i get access denied when i go to commit changes. So i want to know the right way to do it before i ask for more permission ( though this is just a test copy of AD)


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.