Share via

directoryEntry property list

Daniel Campos 6 Reputation points
2021-07-22T03:11:59.423+00:00

I'm programming in ActiveDirectory and I need the DirectoryEntry property list with their descriptions.
I found some fields, but I would like more composed to fill, type account options, password expiration etc.

Below is a text of the code I'm doing

            obDominio = new DirectoryEntry(nomeDominio);
            DirectoryEntries entrada = obDominio.Children;
            DirectoryEntry dados = entrada.Add("CN=" + displayName + "," + cbOus.Text, "User");
            dados.Properties["samAccountName"].Add(accountName); 
            dados.Properties["givenName"].Add(givenName);
            dados.Properties["sn"].Add(surName);              
            dados.Properties["displayName"].Add(displayName);
            dados.CommitChanges();

In this case, I need field references to put in "dados.Properties["?"]"

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


1 answer

Sort by: Most helpful
  1. Timon Yang-MSFT 9,611 Reputation points
    2021-07-29T07:19:39.373+00:00

    Sorry for the late reply. You need to post a comment after you modify it to let the platform send an email to remind people who have followed this thread to know,I forgot to remind you of this.

    Please read this document, is this what you need?

    All Attributes


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.