G
Guest
Hi,
I am using this code(.NET2.0 ) to create the user on the domain Controller
which is installed on my machine:
try {
DirectoryEntry objUsers = new DirectoryEntry
("LDAP://localhost/OU=Alcatel,DC=alcatalnsit,DC=com");
DirectoryEntry objNewUser = objUsers.Children.Add("CN=" +
"txtFirstName"+"txtLastName", "user");
objNewUser.Properties["sAMAccountName"].Value = ("txtFirstName"
+"txtLastName");
objNewUser.Properties["givenName"].Value = "txtFirstName";
objNewUser.Properties["sn"].Value = "txtLastName";
objNewUser.CommitChanges();
}
Catch(Exception ex)
{
Console.Writeline(ex.ToString());
}
1. on the second line it throws the exception InteropServicesCOMException
"The specified Directory object is not bound to a remote
resource" (and Error code property is -2147463159)
and at the catch block it writes the message
2. DirectoryServicesCOMException:A Device attached to the system is not
functioning (Exception from HRRESULT 0x8007001f)
Any Clue!!!!
Thanks & Regards
Rajnish
I am using this code(.NET2.0 ) to create the user on the domain Controller
which is installed on my machine:
try {
DirectoryEntry objUsers = new DirectoryEntry
("LDAP://localhost/OU=Alcatel,DC=alcatalnsit,DC=com");
DirectoryEntry objNewUser = objUsers.Children.Add("CN=" +
"txtFirstName"+"txtLastName", "user");
objNewUser.Properties["sAMAccountName"].Value = ("txtFirstName"
+"txtLastName");
objNewUser.Properties["givenName"].Value = "txtFirstName";
objNewUser.Properties["sn"].Value = "txtLastName";
objNewUser.CommitChanges();
}
Catch(Exception ex)
{
Console.Writeline(ex.ToString());
}
1. on the second line it throws the exception InteropServicesCOMException
"The specified Directory object is not bound to a remote
resource" (and Error code property is -2147463159)
and at the catch block it writes the message
2. DirectoryServicesCOMException:A Device attached to the system is not
functioning (Exception from HRRESULT 0x8007001f)
Any Clue!!!!
Thanks & Regards
Rajnish