,您可以访问“注释”目录项的字段,例如:
// 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