域控制器win2003与 IIS6.0属同一台机.
程序直接在域控制器上运行.
添加函数如下:
public int adduser(string loginname,string xing,string ming,string password)
    {
        DirectoryEntry de=new DirectoryEntry();
        de.Path = "LADP://OU=Students";
        de.Username = "administrator";
        de.Password = "1234567";
        DirectoryEntries users=de.Children;
        DirectoryEntry user = users.Add("CN="+xing+ming, "user");
        user.Properties["sAMAccountName"].Add(loginname);
        user.Properties["userPrincipalName"].Add(loginname + "@liao.cn");
        user.Properties["givenName"].Add(ming);
        user.Properties["sn"].Add(xing);
        user.Properties["userPassword"].Add(password);
        user.CommitChanges();        return 0;    }运行后指出DirectoryEntry user = users.Add("CN="+xing+ming, "user");行有误.
错误提示是:
System.Runtime.InteropServices.COMException:Unknown error(0x80005000).