域控制器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).
程序直接在域控制器上运行.
添加函数如下:
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).
解决方案 »
- 请问如何使label的text可以复制???
- Crstal Report是否在Report Footer中显示某分组的全部组名.
- 求个简单问题,C#读取EXCEL文件
- Treeview的用法,简单的我不会用了
- listView Items显示问题 兄弟初来乍到 多帮忙【有代码】
- c#里有没有相当于memcpy的函数?
- CommandText没有初始化怎样解决?
- 高分求教:如何设置htmlinputfile的文件选择类型(mime类型)?
- 在picturebox上画图,然后按了最小化,却出现了错误
- c#的server服务怎么做有界面的
- 在C#中用何种数据结构存储treeview?
- 哪里有winform多线程下载的实例?
本程序属ASP.net,直接在域控制器上以http://localhost形式运行.
try
ldap://RootDse/....
2、asp.net 下默认是没有权限添加用户的