3
Answers

Why i am geeting this exception A device attached to the system is not functioning.

Ramu Ramu

Ramu Ramu

14y
5.6k
1
Hello

I am working with AD and i have to add users to the group if they are not present in the group. 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 group directly. 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 group and when i tried next time with the same 10 users the group updates successfully. 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()

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.

Answers (3)