在服务器中使用ldap创建组时出错,请给我解决方案 [英] having error in creating group using ldap in sever pls pls plss give me solution

查看:177
本文介绍了在服务器中使用ldap创建组时出错,请给我解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我发现错误-
目录服务com异常被捕获
指定的目录服务属性或值不存在. (来自HRESULT的异常:0x8007200A)

这是我的代码-

Hello people,

I found error as -
Directory service com exception was caught
The specified directory service attribute or value does not exist. (Exception from HRESULT: 0x8007200A)

Here my code -

DirectoryEntry ent = new DirectoryEntry("LDAP://serverip", "username", "password", AuthenticationTypes.Secure);
ent.Children.Add("cn='" + TxtGroupName.Text + "'", "group");
ent.Properties["saMAccountName"].Add(TxtGroupName.Text);
ent.Properties["groupScope"].Add("0x02");
ent.Properties["groupType"].Add("0x80000000");
ent.CommitChanges();
MessageBox.Show("creted");


请给我解决方案.


Please give me solution.

推荐答案

选中此

指定的目录服务属性或值不存在. (来自HRESULT的异常:0x8007200A) [ ^ ]
Check this

0x8007200a (The specified directory service attribute or value does not exist)[^]

EDIT
---------------------
The specified directory service attribute or value does not exist. (Exception from HRESULT: 0x8007200A)[^]


我打开广告计划,未找到属性groupScope.您确定您的方案中存在该目录吗?
I open my AD scheme and not found attribute groupScope. Are you sure, that this one exists in your scheme?


DirectoryEntry ent = new DirectoryEntry("LDAP://serverip",用户名",密码",AuthenticationTypes.Secure);
ent.Children.Add("cn =""+ TxtGroupName.Text +"'',"group");
ent.Properties ["saMAccountName"].Add(TxtGroupName.Text);
ent.Properties ["groupType"].Add("0x80000002");
ent.CommitChanges();
MessageBox.Show("creted");
DirectoryEntry ent = new DirectoryEntry("LDAP://serverip", "username", "password", AuthenticationTypes.Secure);
ent.Children.Add("cn=''" + TxtGroupName.Text + "''", "group");
ent.Properties["saMAccountName"].Add(TxtGroupName.Text);
ent.Properties["groupType"].Add("0x80000002");
ent.CommitChanges();
MessageBox.Show("creted");


这篇关于在服务器中使用ldap创建组时出错,请给我解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆