Ramu Ramu

Ramu Ramu

  • NA
  • 5
  • 5.9k

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

Mar 31 2010 1:30 PM
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)