Trying to add a new entry to SUN LDAP

Hey im trying the following code to add a new user to a group using VB.NET but no success yet
Dim de As New DirectoryEntry("LDAP://www.m1steveldap.com:389/ou=people,dc=steveldap,dc=com,o=broker")
        de.Username = "cn=manager"
        de.Password = "password"
        de.AuthenticationType = AuthenticationTypes.None
        Try
            Dim entries As DirectoryEntries = de.Children
            Dim newUser As DirectoryEntry = entries.Add("CN=test man", "user")
            newUser.Properties("givenname").Add("steven")
            newUser.Properties("uid").Add("steven")
            newUser.Properties("sn").Add("steven")
            newUser.CommitChanges()But getting the following error
The requested operation did not satisfy one or more constraints associated with the class of the object. (Exception from HRESULT: 0x80072014)
Any ideas ?

every entry in an ldap directory must have some mandatory attributes, e.g. "objectClass". which objectclass your entry should belong to? add the objectClass-attribute to your entry!
Regards!
Rainer

Similar Messages

  • Cannot create and add a new entry to LDAP

    Hi,
    I'm pretty new at LDAP and JNDI, i've been trying to create and add a new entry to the directory but somehow it's not working.
    here is my code and I would appreciate it if someone can help.
    import java.util.Hashtable;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    import javax.naming.*;
    import javax.net.ssl.*;
    import java.io.*;
    public class Newuser
         public static void main (String[] args)
              //LDAPEntry myEntry = new LDAPEntry();
              Hashtable<String, String> env = new Hashtable<String, String>(11);
              String adminName = "CN=ldap_admin,o=JNDITutorial,dc=img,dc=org";
              String adminPassword = "secret";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial,dc=img,dc=org");
                   // Create the initial directory context
                   //JNDILDAPConnectionManager jndiManager = new JNDILDAPConnectionManagerImpl();
                  try{
                       DirContext ctx = new InitialDirContext(env);
                        System.out.println("Connection to LDAP server done" );
                       final String groupDN ="ou=people,o=JNDITutorial,dc=img,dc=org";
                      //DirContext dirCtx = jndiManager.getLDAPDirContext();
                      People people = new People("Thiru","Thiru","Thiru Ganesh","Ramalingam","ou=people","[email protected]");
                      // The Common name must be equal in Attributes common Name
                      ctx.bind("cn=Thiru," + groupDN, people);
                      System.out.println("** Entry added **");
                      //jndiManager.disConnectLDAPConnection(ctx);
                  }catch(NamingException exception){
                      System.out.println("**** Error ****");
                      exception.printStackTrace();
                      System.exit(0);
    }here is the Object class People that i'm trying to instantiate
    public class People implements DirContext {
         public People(String uid,String cn,String givenname,String sn,String ou,String mail) {
        BasicAttributes myAttrs = new BasicAttributes(true);  //Basic Attributes
        Attribute objectClass = new BasicAttribute("objectclass"); //Adding Object Classes
        objectClass.add("inetOrgPerson");
        /*objectClass.add("organizationalPerson");
        objectClass.add("person");
        objectClass.add("top");*/
        Attribute ouSet = new BasicAttribute("ou");
        ouSet.add("people");
        ouSet.add(ou);
        myAttrs.put(objectClass);
        myAttrs.put(ouSet);
        myAttrs.put("cn",cn);
        myAttrs.put("sn",sn);
        myAttrs.put("mail",mail);
    ...the message i keep getting is:
    javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - entry has no objectClass attribute]
    the thing is that I can create and add a new entry in openLDAP from the console and it works.
    and here is how I proceed
    I create a text file: new.txt
    dn:cn=Hamido Saddo,ou=People,o=JNDITutorial,dc=img,dc=org
    cn:Hamido Saddo
    mail:[email protected]
    telephonenumber:3838393038703
    sn:hamdio
    objectclass:top
    objectclass:person
    objectclass:organizationalPerson
    objectclass:inetOrgPersonand i use this command to add the entry:
    ldapadd -D "cn=ldap_admin,O=JNDITutorial,dc=img,dc=org" -W -f new.txtand everything works, i get no errors.
    does anyone has a clue maybe???

    You must have an IMAP email account in order to add additional folders on the iPad mail app.
    If you go to your email account in the Mail app and look at the window where your inbox, trash folder and sent folder are - if there is an Edit button at the top of the window - tap that and then tap Add Mailbox at the bottom.
    If the Edit button is not there - you cannot create folders on the iPad. Your email account is not IMAP. Only IMAP email accounts can create folders on the iPad. Any folders that you would already have in an IMAP account would sync to the device as well.

  • Trying to add a new node to OAS

    I'm trying to add a new node to our OAS server, and it always fails. Any hints on what I might be doing wrong?

    every entry in an ldap directory must have some mandatory attributes, e.g. "objectClass". which objectclass your entry should belong to? add the objectClass-attribute to your entry!
    Regards!
    Rainer

  • I am trying to add a new credit card and it keeps telling me that I have to enter a valid security code...I have tried 2 different cards and it is doing the same thing. How do I get past this?

    I guess it has been a year since I last purchased something on I-tunes and my account is saying that they couldn't authorize my card for some of my purchases.  I am trying to add a new credit card to clear this up and it keeps saying that I have to enter a valid security code.  I have tried 2 different cards and I get the same thing.  I have also added an I-tunes gift card and that isn't clearing up the money that I owe.  It is showing that I have a $25 credit for that.  How do I fix this, I have been trying for days and all I have got from the e-mail tech support is that its my credit card issuer that is causing the problem.  Thats not correct because one of the credit cards that I am trying to use, is a prepaid Visa gift card.  I know that these work on I-tunes because I have used them before in the past.  I am getting very frustrated with this whole process, I just want to clear up my account and buy some new music!! HELP!!

    You probably ran into blocks & locks.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html
    They'll sort it out.

  • How can I add a new entry for determining a requirement type

    Dear Friends,
    How can I add a new entry for determining a requirement type
    via Item Category + MRP type,  I see no new entries selection.
    This is in  Avb Check & TOR-> TOR-> Determination of req type using transaction.
    Please help.
    Regards
    Ravi.

    Availability Check and Transfer of Requirements > Transfer of Requirements > Define Requirements Types ?
    Just one node above?
    Never mind, you need to add entry on item category:S

  • Error while trying to add a new field in search criteria by VO extension

    Hi,
    I am trying to add a new field by using the VO extension to a seeded OAF page used to search Repository contracts.
    I get the following error on opening the page after I have compiled my code on server and bounced apache.
    Message not found. Application: FND, Message Name: FND_VIEWOBJECT_NOT_FOUND. Tokens: VONAME =SSPN_AdvancedSearchAttributesPVO; APPLICATION_MODULE = oracle.apps.okc.repository.search.server.ContractsAdvSearchAM;
    I extended the AM also after this to include the extended VO but still the error comes.
    This page is a dynamic search page where the results change based on the different search criteria.
    Cheers
    Swati

    Hi,
    I extended the AM also after this to include the extended VO but still the error comes.There is no need to extend the AM for extending a VO. Hopefully the VO which u extending already attached to the AM oracle.apps.okc.repository.search.server.ContractsAdvSearchAM.
    Regards,
    Gyan

  • 2 yrs worth of music on my ipod nano 5th gen just vanished while I was trying to add four new tracks.

    Most of the music I've put on my ipod nano 5th gen in the last 2 years just vanished while I was trying to add four new tracks. Stuff from before that seems to be still there (I add stuff manually, not sync, and the ipod wasn't full). It was a bit glitchy as soon as I plugged it in to update - threw up a few error messages, decided to verify my ipod a couple of times, After that, once or twice itunes seemed to lose the ipod completely, although as far as the laptop was concerned it was definitely still connected, so i went for the 'safe to remove hardware' option and reconnected...
    I'm guessing somewhere in the midst of whatever was going on there, something got confused or corrupted, but I have no way to tell what... Ipod seems to think it is using less of its capacity now, but I don't know whether to believe it or not!
    Can I get this stuff back? It's not just stuff I bought from itunes, either - things I put on from cds have gone too. I have all the music either backed up or on cds, but I'm not in the same country as my cds right now - also rebuilding all of my playlists and trying to remember what went where is going to be a pain! Is there a quicker way than just doing it all over again?

    Downloading past purchases from the App Store, iBookstore, and iTunes Storehttp://support.apple.com/kb/HT2519
    Message was edited by: michael08081

  • My iphone 6 plus after updating to IOS 8.2 the touch id doesn't work neither in home unlock nor in app store and when i'm trying to add a new fingerprint it says ''failed unable to complete touch id setup.Please go back and try again'' .

    my iphone 6 plus after updating to IOS 8.2 seems to have a problem with the touch id witch doesn't work neither in home unlock nor in app store and when i'm trying to add a new fingerprint it says ''failed unable to complete touch id setup.Please go back and try again'' . I have multiple fingerprints and none of them appear to work.

    Hi Giannis,
    If you are having an issue with Touch ID not functioning as expected, I would suggest that you troubleshoot using the steps in this article -
    Use Touch ID on iPhone and iPad - Apple Support
    Start with the section titled Clean the Touch ID sensor and then Get help with Touch ID.
    Thanks for using Apple Support Communities.
    Sincerely,
    Brett L

  • Trying to add the new year 2012 to posting periods

    I am trying to add the new 2012 months in posting periods in order to allow us to post some invoices that have terms due in 2012. First, when I go to add a new period the "category" feild is missing. Im guessing this has to be added somewhere else but I am not sure. Second, When I go to add the actual month for January 2012, I get the error "Enter Valid code [Posting Period -Period Code], '-' [Message 173-36]. Not really sure why I cant add this but I am guessing there is a step before I am missing. Any suggestions please...thank you!

    I figured out how to add it, I was adding the month as 2012-01, yet I only had to put 2012 and it would pre-fill in the dates then. Thanks anyways!

  • I am trying to add some new software and am told I have an incorrect software that I already confirmed is correct.  Can anyone help???

    I am trying to add some new software and am told I have an incorrect software that I already confirmed is correct.  Can anyone help???

    Please confirm you are actually running the ancient OS 8.6.
    What software is this?

  • Hi experts,  Since i am trying to add a new field in pa0006 ...the sap stan

    Hi experts,
    Since i am trying to add a new field in pa0006 ...the sap standard view t528c has been modified..how can i restore the old view(total fields has been changed)

    Check the version mangement and retrive the request with your old changes.

  • Get an error when trying to add a new object!

    Post Author: zhaodifan
    CA Forum: Administration
    I was trying to add a new object from central management console and I got the following error:
    Retrieve Error
    There was an error while retrieving data from the server: Failed to read data from report file C:\WINNT\Temp\pres_report.rpt. Reason: Operation not yet implemented. File C:\WINNT\TEMP\tmpreport\~ci226c521bf2923e0.rpt.
    The report I am trying to add was running on a Linux box with the same version BusinessObjects Cyrstal 11 running. I want to move it to a Windows box... The report itself shouldn't have problems because it was running fine on the linux box...
    Also want you let you know that I don't know too much about Crystal Report and our Crystal Report admin quited his job last week! I will be very appreciated if anybody can give me any advice. Thank you!
    Difan

    If this is a Gmail account you might need to unlock by going here: https://accounts.google.com/DisplayUnlockCaptcha.

  • Creative cloud keeps crashing after trying to add a new font?

    I recently tried to add a new font to my library with typekit. As soon as the download was complete, at the point where it should have synched, my creative cloud crashed.
    Now, i can still start creative cloud, and i can even get to the primary menu, but 10 seconds after launching it, it crashes. What can i do?

    Mail.app crashes while setting up an Exchange Account

  • Get the following error when trying to add a new user - Error of type eDSSchemaError (-14142) on line 1235 of /SourceCache/WorkgroupManager/WorkgroupManager-421/PMMUGMainView.mm

    Get the following error when trying to add a new user on Mac OS Server 10.5 - Error of type eDSSchemaError (-14142) on line 1235 of /SourceCache/WorkgroupManager/WorkgroupManager-421/PMMUGMainView.mm

    How come Leopard let me use the WGM in standard mode?
    While SA complains that it won't work in Standard Configuration, WGM does not. There is some fault in the logic of this for which I don't have an explanation.
    If I want to get control on Dock, selection of Home folder, config of Proxy... which I think are basic things, do I really need the advanced mode?
    If you wish to have complete control of all client settings, yes. There really is no disadvantage of using an Advanced configuration other than the learning curve.
    So if I switch to advanced mode, there is good chance I won't get this error message anymore, right?
    Yes.

  • CSM 4.1 Authorization error when trying to add a new device

                       Hi, i just finished installing a new CSM 4.1 and i set it up to use the local windows user accounts for its administration. So when i login to the CSM i use the same username/password as the one used to login to the underlying Windows OS.
                        When i am trying to add a new device in CSM i get an error saying that i do not have enough rights to do that. Any ideea why this happens?
    Thanks,
         Costin

    You seem a little grumpy. Yes, it has acurred to me that no one knows the solution. And no, I have not called tech support yet as I have been distracted lately and spending an hour on the phone trouble shooting is an hour I could be studying. Its much easier to "bump" this thread and hope someone with a suggest will chime in.
    Anyway, please dont just tell me to delete something without giving me an idea of what Im deleting. I have a feeling that this login.keychain deletion will cause me to loose the information already stored. Is this the truth?

Maybe you are looking for