I am compiling a quick C # form application to help solve the repetitive clerical work.
I searched AD for all user accounts and add them to the checkbox list view.
I would prefer the default validation status for listviewitems to depend on the account on / off status.
string path = "LDAP://dc=example,dc=local"; DirectoryEntry directoryRoot = new DirectoryEntry(path); DirectorySearcher searcher = new DirectorySearcher(directoryRoot, "(&(objectClass=User)(objectCategory=Person))"); SearchResultCollection results = searcher.FindAll(); foreach (SearchResult result in results) { DirectoryEntry de = result.GetDirectoryEntry(); ListViewItem lvi = new ListViewItem( (string)de.Properties["SAMAccountName"][0]);
I am trying to find the right attribute for analysis in order to get the state of an account from a DirectoryEntry object. I searched for AD user attributes but didn't find anything useful.
Can anyone suggest any pointers?
c # attributes active-directory directoryservices
Bryan Jan 05 '10 at 11:21 2010-01-05 11:21
source share