【发布时间】:2011-03-14 18:13:23
【问题描述】:
string ouString = projectBox.Text.ToString();
string parentName = "LDAP://OU="+ouString+",OU=Clients,OU=Clients,DC=domain,DC=net";
DirectoryEntry parentEntry = new DirectoryEntry(parentName);
DirectoryEntry newGroup = parentEntry.Children.Add("CN=" + ouString+"SecGroup", "group");
newGroup.Properties["member"].Add("ExistingGroup");
newGroup.CommitChanges();
newGroup.Dispose();
parentEntry.Dispose();
抛出异常:
服务器不愿意在 newGroup.CommitChanges() 处处理请求;有什么想法吗?
没有密码问题,我相信这可能与没有找到“ExistingGroup”有关。如果我注释掉 newGroup.Properties["member"].Add("ExistingGroup");它会很好地创建 sec 组。我正在尝试创建一个新的安全组并同时使其成为另一个组的成员。
newGroup.Properties["member"].Add("CN=Clients Clients,OU=Clients,DC=domain,DC=net");
您必须完全限定组位置....
但这恰恰相反。它使 ExistingGroup 成为 newGroup 的成员,反之亦然...
【问题讨论】:
标签: c# windows security active-directory ldap