问题
Active Directory groups have a 'Notes' property available through the interface (see image below)
Is it possible to retrieve this information in C#?
I can't seem to find the property that holds it. I've tried using the System.DirectoryServices.DirectoryEntry
and System.DirectoryServices.AccountManagement.GroupPrincipal
objects but none of them seem to have it.
回答1:
There is a property called info
which holds the information shown within this field. But it will only be added to the AD object if a value is available.
If you like to see all elements that have a text within this field. Simply open the AD Browser (start dsa.msc
) and open a new search. Change the selection within the "Find" combobox to Custom Search
, click on Advanced
and enter the text info=*
. Now you'll get back a list of all elements which having this field.
回答2:
I'm not sure but, have you ever checked DirectoryEntry.Properties property?
Gets the Active Directory Domain Services properties for this DirectoryEntry object.
Check out these articles;
- Accessing Global Address List via System.DirectoryServices Namespace
- Function to Print DirectoryEntry properties
- How to access the notes field on a GroupPrincipal object
来源:https://stackoverflow.com/questions/14873132/is-it-possible-to-get-group-notes-from-active-directory