473,503 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add LDAP member to LDAP group!

4 New Member
Hi folks,
I have been trying (in C# 2.0) using several ways to add an LDAP Member object to a group.

Below you can see the code and two of the ways I tried:

Expand|Select|Wrap|Line Numbers
  1. DirectoryEntry newEntry; 
  2.  
  3.  //.....
  4.  // Creating the LDAP member entry.....no problems here!!!
  5.  //....
  6.  
  7. using (DirectoryEntry groupEntry = GetGroupEntry())
  8. {                
  9.         groupEntry.Properties["member"].Add(newEntry.Path);
  10.         groupEntry.CommitChanges();   <-- Exception here
  11. }
  12.  
  13. COMException: ex = {"The attribute type specified to the directory service is not defined. (Exception from HRESULT: 0x8007200C)"}
I have also tried:
groupEntry.Invoke("Add", new object[] { newEntry.Path });
In this case I get:
"Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))"
right after the Invoke method!

Any help or comment is most appricated!
Mar 2 '08 #1
6 3091
kenobewan
4,871 Recognized Expert Specialist
Seems to be a problem with newEntry.Path. What is its value?
Mar 2 '08 #2
Ilios78
4 New Member
Seems to be a problem with newEntry.Path. What is its value?
The newEntry object is created and used with no problems!
newEntry.Path = "LDAP://dev1:1003/cn=myuser1,ou=Members,o=InMembership"
Mar 3 '08 #3
kenobewan
4,871 Recognized Expert Specialist
So you are trying to add the ldap query as a property of the group entry member?
Mar 3 '08 #4
Ilios78
4 New Member
So you are trying to add the ldap query as a property of the group entry member?
Ok.. Is that wrong? What should I pass to the "add" method. Besides from the exception I get I think the group entry does not have a "member" property. Not that it does not understand the user entry object! But please let me know if you still think I am doing something wrong!

Thanks
Mar 3 '08 #5
kenobewan
4,871 Recognized Expert Specialist
I thought that you would have wanted to add group properties such name. I don't believe the ldap query is a valid property of the group. HTH.
Mar 4 '08 #6
Ilios78
4 New Member
I thought that you would have wanted to add group properties such name. I don't believe the ldap query is a valid property of the group. HTH.
The Path property is what uniquely defines an LDAP entry! I did try (just for being sure) passing the username and “name” property but as expected I got the same COM exception.
Mar 4 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3819
by: Mike Discenza | last post by:
I'm working on a new system that my superiors have determined should use LDAP for it's authentication and user management. Not real bad, but it's proving to be a bit of a hassel. I'm using a...
5
2854
by: dmcconkey | last post by:
Hi folks, I've been searching for a while and haven't found my specific question anywhere else. If this has already been asked, please accept my appologies and point me to the appropriate...
1
2051
by: | last post by:
I have the following code to show all members of a domain global group that is selected from a drop down list. I can display the property "member" just fine which shows a listing like: ...
0
4711
by: Vikram | last post by:
Hi, Can any give me an example which collects all the users of a given group. Im on Win2000 domain, using c#. Currently my code below gives me only users directly in the group and not in nested...
3
2022
by: Jay | last post by:
I have a simple LDAP query (grabs all users from a particular AD group and populates a checkboxlist) that works perfectly fine on the development machine logged on locally as any user. When I...
3
9866
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't...
0
3198
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...
2
4563
by: antem | last post by:
I receive only members from domain global goup in wich my NT-Account is too. If domain global group belongs to a foreigner domain i get no members. Perhaps I will not be able cause I got not enaugh...
1
5422
by: Erick Perez - Quadrian Enterprises, S.A. | last post by:
Hi, I have a MS Windows AD domain, and have one OU with more tan 1000 users objects. When I try to read it, I hit the 1000 limit of AD while returning objects, so I'm asking for advice as to how...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6991
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
7462
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
5578
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
5014
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
4673
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
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.