Results 1 to 7 of 7
- 11-25-2010, 03:35 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
Creating a Group in Active Directory
Hey Folks,
I want to simply create a group in my Active Directory via Java and ldap-protocol. I´ve got a connection, can read Groups/Users and so on.
Do I need any further class libraries or does java offer these options to create a group and I´m just to stupid to find it?! =P
I couldn´t find anything about it, yet. I would be very happy if someone could give me an example or just a little hint =)
Greetings
Bumbsiii
- 11-25-2010, 07:27 PM #2
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
What is your ldap server and what is your ldap client? MS? Apache? Novell?
I guess this can help:
Novell Documentation
Find example:
'AddEntry.java'
cheers
- 11-26-2010, 01:40 PM #3
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
Yeah that worked nice. Had some trouble, because I was to stupid to take the right objectclass but now everything works fine =)
Thanks, FON =)Last edited by Bumbsiii; 11-26-2010 at 01:46 PM.
- 11-26-2010, 03:27 PM #4
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
I'm glad i can help :)
Can you pls share that solution with rest of forum people,
so they have a reason to read this thread when needed?
- 12-06-2010, 07:44 AM #5
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
I hope this is enough to explain that =P
PHP Code:public void createGroupsInAD() throws LDAPException, UnsupportedEncodingException { LDAPConnection lc = new LDAPConnection(); lc.connect("10.0.0.64", 389); lc.bind(LDAPConnection.LDAP_V3, ADMIN_NAME, ADMIN_PASSWORD.getBytes("UTF8")); try { LDAPAttributeSet loAttrSet = new LDAPAttributeSet(); String dn = "cn=Groupname,ou=Security Groups,ou=MyBusiness,dc=OC,dc=local"; loAttrSet.add(new LDAPAttribute("objectclass", new String("Group"))); loAttrSet.add(new LDAPAttribute("name", new String("Groupname"))); loAttrSet.add(new LDAPAttribute("sAMAccountname", new String("Groupname"))); loAttrSet.add(new LDAPAttribute("description", new String("All Groupnames"))); LDAPEntry newEntry = new LDAPEntry(dn, loAttrSet); lc.add(newEntry); } catch (Exception e) { // TODO: handle exception } try { LDAPAttributeSet loAttrSet = new LDAPAttributeSet(); String dn = "cn=Groupname2,ou=Security Groups,ou=MyBusiness,dc=OC,dc=local"; loAttrSet.add(new LDAPAttribute("objectclass", new String("Group"))); loAttrSet.add(new LDAPAttribute("name", new String("Groupname2"))); loAttrSet.add(new LDAPAttribute("sAMAccountname", new String("PO_ADMIN"))); loAttrSet.add(new LDAPAttribute("description", new String("All Groupname2"))); LDAPEntry newEntry = new LDAPEntry(dn, loAttrSet); lc.add(newEntry); } catch (Exception e) { // TODO: handle exception } lc.disconnect(); }
- 01-06-2011, 05:05 AM #6
Member
- Join Date
- Jan 2011
- Posts
- 1
- Rep Power
- 0
I could not find the LDAP connection classes to compile this. Can you tell me where i can get the classes to compile this code?
- 01-17-2011, 08:09 AM #7
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
I don´t know exactly which documentation this was.
It were definitely the novell ldap libraries, I think this one:
Novell LDAP Extended Library
Greetings
Similar Threads
-
Pulling from an Active Directory
By Sno in forum New To JavaReplies: 1Last Post: 09-24-2010, 09:15 PM -
Creating File inside a Directory
By viswanadh7 in forum AWT / SwingReplies: 1Last Post: 03-17-2009, 02:22 AM -
Accessing Active Directory using JNDI
By Chandran in forum Advanced JavaReplies: 0Last Post: 02-25-2009, 12:04 PM -
Accessing Active Directory
By javaplus in forum Advanced JavaReplies: 1Last Post: 01-04-2008, 11:25 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks