473,659 Members | 2,663 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.Invo ke("Add", new object[] { newEntry.Path });
In this case I get:
"Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWN NAME))"
right after the Invoke method!

Any help or comment is most appricated!
Mar 2 '08 #1
6 3105
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=M embers,o=InMemb ership"
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
3843
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 Lotus Domino server for the LDAP part. If, in the ldap_search(...) function I pass it "o=myCompany" for the dn parameter (the second parameter), I only get back the list of users, not the groups. I only want back the groups in this instance. ...
5
2867
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 thread. I'm bidding on a PHP intranet development contract. One of the specific requirements is that the app interface with the company's existing Open LDAP server for user authentication.
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: CN=Jones\, Bill, CN=Group, OU=domain However, I need to go a step further and display other information about a user such as phone number, building, etc. Is there anyway to find the information I need from AD with what is returned form the property...
0
4725
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 group. DirectorySearcher searcher = new DirectorySearcher(); DirectoryEntry ContextEntry = new
3
2028
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 access the website and run the query from a client however the query fails to run. Someone please help? Here's the code for the query (in CheckBoxListsFill sub): 'Impersonate the Windows AD user running the application Dim impersonationContext...
3
9875
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 seem to get this to work in VB.Net. Here's what I have: OLD ASP Code: Function Get_ADS_Users_For_Group(ADS_Path) Dim Group_Information Dim Error_Number
0
3222
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 given all the attributes which are needed, for the user, in the code and also the proper path where the user has to be added. Please have a look at my code CODE] // This is a class file which stores all the info required for the user
2
4574
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 rights. So I start to search only for goupnames and a users in foreigner Domains and I get all Information. Next step I start to search the member with the Windowsexplorer and I recive also all members of the foreigner domain global group. I...
1
5443
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 to read them. Here is my actual code, it is not the cleanest as I am learning python. Suggestions are welcomed :) Runnig this script on RedHat 5.x with "python zimbra2.py" returns: {'info': '', 'desc': 'Size limit exceeded'}
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.