tags:

views:

875

answers:

4

I am new to LDAP development so please forgive my ignorance on the subject. I am on a project where I need to manage groups and group membership in Novell eDirectory using .NET. I have found several examples of creating groups in Active Directory but all of these examples use SamAccountName which is specific to active directory. Can anyone share some more generic code that would work against any LDAP store?

Specifically I am looking to implement the following functions:

  1. Group creation
  2. Group deletion
  3. Add user to group
  4. Remove user from group

Thanks!

A: 

Check out these other two SO questions on eDirectory and C# - they should give you some more insight and links to dig deeper:

There seem to be some issues with using the standard System.DirectoryServices classes with Novell directories, and I'm not 100% what the latest is on the Novell C# LDAP classes mentioned in those questions.

Marc

UPDATE:
Here's a list of Quick C# Code Examples on using System.DirectoryServices on MSDN, or here's a How to do just about evertyhing in Active Directory article on CodeProject. Both contains lots of examples of commonly requested function and how to code them. Hope this helps.

marc_s
I am able to connect to eDirectory successfully. The help I need is with group and group membership management. I'm not sure of the specifics needed to perform the operations listed.
Doug Perkes
I can give you samples of how to do that in Active Directory, but I'm not sure if those will work on Novell eDirectory the same way.
marc_s
A: 

Group management in eDirectory is different than in Active directory.

A Group has two attributes of interest (Member and Equivalent To Me) and a User has two attributes of interest (Group Membership and Security Equals).

Adding a User to a group updates all four of those attributes, when done correctly.

The security/equivalent attributes are the mechanism by which rights and trustees are handled, so you can skip those if not being used inside eDirectory, but best if you do not.

geoffc
Thanks for the information. Do you have any examples of how to do it correctly?
Doug Perkes
+1  A: 

I hate to answer my own question, but I finally found some samples that I can use. Looks like there is a Novell eDirectory C# LDAP api that was written that includes samples for creating objects and managing group membership.

I'd rather use the .NET System.DirectoryServices API's so I'll give them a try using the samples above as examples of the attributes I need to set.

Doug Perkes
A: 

So all this depends on how you use eDirectory. Is it used for a file and print directory where users may have various rights assigned within eDirectory to other parts of eDirectory or is eDirectory just used for another LDAP server?

If you do not assign eDirectry rights to users through groups, you really only need to to set the member attribute on the group.

If you do assign rights in eDirectory via groups, then you need to set all four attributes as described here:

http://ldapwiki.willeke.com/wiki/Groups%20Edirectory

-jim

jeemster