I query all security groups in a specific domain using
PrincipalSearchResult results = ps.FindAll();
where ps is a PrincipalS
You can access the 'notes' field of a directory entry as such:
// Get the underlying directory entry from the principal
System.DirectoryServices.DirectoryEntry UnderlyingDirectoryObject =
PrincipalInstance.GetUnderlyingObject() as System.DirectoryServices.DirectoryEntry;
// Read the content of the 'notes' property (It's actually called info in the AD schema)
string NotesPropertyContent = UnderlyingDirectoryObject.Properties["info"].Value;
// Set the content of the 'notes' field (It's actually called info in the AD schema)
UnderlyingDirectoryObject.Properties["info"].Value = "Some Text"
// Commit changes to the directory entry
UserDirectoryEntry.CommitChanges();
Took a little bit of hunting - I had assumed the notes property was indeed called 'notes', ADSIEdit to the rescue!
i was able to change that field.
entryToUpdate.Properties["info"].Clear(); entryToUpdate.Properties["info"].Add("some text you want here");
So thanks Brad :)
I have been returning to this challange over and over again, but now I have finally given up. It sure looks like that property is inaccessible.
For anybody using the "info" attribute:note that it will throw an exception if using an empty string or null value.