连接到系统的设备无法在Active Directory编程中运行 [英] A device attached to the system is not functioning in Active directory programming

查看:140
本文介绍了连接到系统的设备无法在Active Directory编程中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我正在使用AD,并且如果分发列表中不存在用户,则必须将用户添加到分发列表中.一切正常,但有时会出现异常,因为连接到系统的设备无法正常工作".在directoryentry.commitchanges()方法中.有时它会成功将用户添加到通讯组列表中.我检查了所有用户名,并且用户名中没有特殊字符,我想知道此异常是由于任何与网络相关的问题所致.而且更重要的是,异常是不一致的,例如,如果我将10个用户添加到通讯组列表时得到了异常,而当我下次尝试使用相同的10个用户时,该列表将使用添加的用户成功更新.我真的不明白为什么我会收到这个例外.任何帮助真的很感激.这是我正在使用的代码块.

Hello

I am working with AD and i have to add users to the distribution list if they are not present in the distribution list . Everything works fine, but sometimes i get the exception as "A device attached to the system is not functioning." at directoryentry.commitchanges() method. and sometimes it successfully adds the user to the distribution list. I checked all the user-names and there is no special characters in the user-name i wonder is this exception is due to any network related issues. And more importantly the exception is not consistent, for example if i get the exception when adding 10 users to a distribution list and when i tried next time with the same 10 users the list updates successfully with the added users. I really don''t understand why i am getting this exception. Any help really appreciated. Here is the block of code i am using.

entry = new directoryentry(LDAP+DL path,username,pwd,authenticationtype.secure)



我将所有过滤器和属性都赋予了负载条件,最后



i gave all the filters and properties to load conditions and finally

child = results[0].getdirectoryentry()



我可以使用child
访问DL的所有属性



i can access all the properties of the DL with child

if(!child.properties["member"].contains("CN=username,ou=something,ou=something," +
                                        "dc=something,dc=com"))
    child.properties["member"].add("CN=username,ou=something,ou=something,dc=something,dc=com")

try{
    child.commitchanges();
}
catch(exp ex)
{
    writelogfile(ex);
}



提前谢谢.

[修改:添加了前置标签]



Thanks in advance.

[Modified: added pre tags]

推荐答案

您是否已解决此问题?

我也面临同样的问题,如果您找到任何解决方案,请告诉我.

在此先感谢,
Sachin Jagtap
Did you get solution on this ?

I am facing the same issue , if you found any solution then please let me know.

Thanks in Advance,
Sachin Jagtap


这篇关于连接到系统的设备无法在Active Directory编程中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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