locked
create user active directory asp net RRS feed

  • Question

  • User-1200535045 posted

     

    Hi all I need to create a user in Active Directory from my application ASPnet could help?
    Thursday, July 2, 2009 10:50 AM

Answers

  • User-796298121 posted

     Try these links.  They have a lot of helpful information on how to create and manage users, as well as handling other tasks in Active Directory.

    http://en.csharp-online.net/User_Management_with_Active_Directory%E2%80%94Creating_Users

    http://www.codeproject.com/KB/system/everythingInAD.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 6, 2009 8:50 AM
  • User-1200535045 posted

     DirectoryEntry parent = new DirectoryEntry(
    "LDAP://OU=usuarios,DC=test,DC=corp",
    null,
    null,
    AuthenticationTypes.Secure
    );

    DirectoryEntry user =
    parent.Children.Add("CN=test.user", "user");

    using (user)
    {
    user.Properties["sAMAccountName"].Value = "test.user";
    user.Properties["userPrincipalName"].Value = "test.user";
    user.Properties["displayName"].Value = "nombre completo";
    user.Properties["givenName"].Value = "Nombre";
    user.Properties["sn"].Value = "apellidos";
    user.Properties["description"].Value = "usuario creado automaticamente";
    user.CommitChanges();
    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 8, 2009 6:05 PM

All replies

  • User-796298121 posted

     Try these links.  They have a lot of helpful information on how to create and manage users, as well as handling other tasks in Active Directory.

    http://en.csharp-online.net/User_Management_with_Active_Directory%E2%80%94Creating_Users

    http://www.codeproject.com/KB/system/everythingInAD.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 6, 2009 8:50 AM
  • User-1200535045 posted

     DirectoryEntry parent = new DirectoryEntry(
    "LDAP://OU=usuarios,DC=test,DC=corp",
    null,
    null,
    AuthenticationTypes.Secure
    );

    DirectoryEntry user =
    parent.Children.Add("CN=test.user", "user");

    using (user)
    {
    user.Properties["sAMAccountName"].Value = "test.user";
    user.Properties["userPrincipalName"].Value = "test.user";
    user.Properties["displayName"].Value = "nombre completo";
    user.Properties["givenName"].Value = "Nombre";
    user.Properties["sn"].Value = "apellidos";
    user.Properties["description"].Value = "usuario creado automaticamente";
    user.CommitChanges();
    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 8, 2009 6:05 PM