,您可以訪問「註釋」目錄項的字段,例如:
// 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();
接過狩獵的一點點 - 我曾以爲Notes屬性確實被稱爲「筆記」,ADSIEDIT救援!
這應該是公認的答案=) – 2013-07-08 20:25:06