473,509 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Active Directory Throws An Error

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

Jul 27 '06 #1
1 3720
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");
I would try using the ACTUAL machine name, not the "virtual" localhost
name, e.g. use

LDAP://yourmachinename/OU=Alcatel,DC=alcatalnsit,DC=com

or alternatively the server name in DNS style notation, something like
this:

LDAP://yourmachinename.alcatalnsit.com/OU=Alcatel,DC=alcatalnsit,DC=com

Does this help at all?

Marc
Jul 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2133
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an...
0
2785
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I...
9
3692
by: Mario Rodriguez | last post by:
Hi people. I have a problem adding users to Win2003 active directory programatically. When I execute my app throws the following exception: .................The specified directory service...
10
5402
by: huzz | last post by:
I have web application that quaries the Active Directory to get user details.. everything works fine but someday I'll get System.Runtime.InteropServices.COMExection and if I restart the client...
1
4732
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
0
1046
by: rkaushik | last post by:
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...
18
23755
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
0
2487
by: bcanter | last post by:
I found a file on the web that will allow you to enumerate groups but it was an .hta and the top level admins won't allow this. I need to give managers access to the groups so that when a new user is...
0
3200
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
0
7234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.