How to add a new user using DirectoryServices?
http://www.codeproject.com/dotnet/addnewuser.aspyou will have a security issue, since normally ASP.NET is run under ASPNET account, you need to run under an account which can add new users to the Active Directory, seeINFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q306158

解决方案 »

  1.   

    also see
    http://support.microsoft.com/default.aspx?kbid=317012Using System.DirectoryServices and Active DirectoryIf a Web application must access Active Directory, the application can use impersonation in an environment that supports delegation. Alternatively, the application can supply explicit credentials to the DirectoryEntry constructor in the System.DirectoryServices namespace to access Active Directory. If the application uses explicit credentials, applications should store credentials appropriately by using a technique such as COM+ construction strings or by using the Windows data protection application programming interfaces (APIs).