Creating a contact in Active Directory

Hello,
I'm new to LDAP and I'm having trouble creating a contact in AD. When I try to create the contact I recieve:
Problem creating contact: javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 00002040: SvcErr: DSID-030508F8, problem 5003 (WILL_NOT_PERFORM), data 0
A fragment of the code I'm using is:
{code}
try {
LdapContext ctx = null ;
Hashtable<String,String> env = new Hashtable<String,String>();
String adminName = "CN=Administrator,CN=Users,DC=antipodes,DC=com";
String adminPassword = "mypassword";
String ldapURL = "ldap://localhost:389";
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,adminName);
env.put(Context.SECURITY_CREDENTIALS,adminPassword);
env.put(Context.PROVIDER_URL,ldapURL);
//Create the initial directory context
ctx = new InitialLdapContext(env,null);
// Create attributes to be associated with the new contact
Attributes attrs = new BasicAttributes(true);
Attribute oc = new BasicAttribute("objectclass") ;
oc.add("top");
oc.add("person");
oc.add("organizationalPerson");
oc.add("mailRecipient");
oc.add("contact") ;
attrs.put(oc);
//Mandatory attributes for a contact object
attrs.put("cn","BFranklin");
//These are optional (but important) attributes
attrs.put("givenName","Benjamin");
attrs.put("sn","Franklin");
// Create the context
Context result = ctx.createSubcontext("CN=BFranklin,OU=Research,DC=antipodes,DC=com", attrs);
System.out.println("Successfully created contact.");
catch (NamingException e) {
System.err.println("Problem creating contact: " + e);
I've been able to perform other operations such as searches and creation of groups, but this has me stumped.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Not sure what the exact problem is. (I always laugh when I see someone using my demo domain name !)
A few things to check.
Is your domain really called "antipodes.com" ? (I know mine is, no idea bout yours !)
Do you have an OU called research ?
Is there already another object (perhaps a user) with the same common name (CN=Albert Einstein) in the OU ?
You may want to simplify the objectClass definition, perhaps your schema definition may be slightly different ? .....
Attributes attrs = new BasicAttributes(true);
//Mandatory attributes for a contact object
attrs.put("objectClass","contact");
attrs.put("cn","BFranklin");
//These are optional (but important) attributes
attrs.put("givenName","Benjamin");
attrs.put("sn","Franklin");
......Othr than that, I'm stumped as well !

Similar Messages

  • Creating group dynamically in active directory depending on their role

    Hi,
    I have sycn oid and active directory using directory integration platform. Now the scenario is We have one system says hr system which take care of entering all the user information. Once it submit that information it goes to oid. Now we want that when we import all that user from oid to active directory it didn't duplicate any user as well as depending on their role it should create groups dynamically in active directory. For e.g: If user belong to Trainee category or manager category it must create Trainee group & Manager group & respective person should go into that group. I don't know whether my question is placed in right group or not. I am using filter to do this task but not able to write proper condition in "source matching filter" and "destination matching rule". Any help will be appreciated.
    Thanks,
    Sonya Sharma

    Thanks Tamim. To clear your thought, i will explain again. I have sync oid and active directory through Directory integration platform. I have created user in oid.(cn=users,dc=mycompany,dc=com). It get sync in active directory properly. Now i have created two group in active directory say for e.g Trainees and Manager. There is a field name position in oid which is a custom attribute. When i fill the information of user in oid, I have to fill "Position" attribute also. So my question is that, if i fill Trainee as a value in Position attribute and click on submit it should go in Trainee Group In active directory and not in user group. Same for manager. How can we achieve this? Can we do it through filter? Or any other way? It's needed desperately. Please help me in resolving this issue.
    Regards,
    Sunil

  • Exchange 2013 mail contact in Active Directory missing SMTP email address but has a primary email address

    Outlook 2010 Distribution Group contact member "Al" is not showing an email address. In Active Directory "Al" is showing an email address but it's not a SMTP email address that is created when you add a new Mail contact using EAC. 
    When the DG owner sends out an email using DG email account, the mail bounces back as undeliverable.
    Exchange Admin Center is not showing the member.  The only way to fix the member is by deleting the contact. Re-add contact in EAC then add to Distribution Group.  We have over 30 DGs that are missing the SMTP email addresses.
    Can a Powershell command fix this issue or is there a sync issue between AD and Exchange?

    Hi,
    From your description, the contact you specified should be contact not mail contact. Contact and mail contact are two different things. If you create a contact in ADUC, you need to mail-enable it and then set the primary SMTP address for it.
    For more information, here is an article for your reference.
    Recipients
    http://technet.microsoft.com/en-us/library/bb201680(v=exchg.150).aspx
    Hope my clarification can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Error while creating a user in Active Directory.

    Hi Guys,
    I am creating a custom connector for AD and Exchnage , I am able to create user in AD using my Java Code... but i am also getting below error, I want to finish the operation smoothly.... Please find below error logs.
    13:51:15,635 ERROR [STDERR] Data AccessException:
    13:51:15,636 ERROR [STDERR] com.thortech.xl.orb.dataaccess.tcDataAccessException: DB_READ_FAILEDDetail: SQL: select UD_AD_CHILD_GRP_NAME from UD_AD_CHILD where UD_AD_CHILD_KEY = Description: ORA-00936: missing expression
    SQL State: 42000Vendor Code: 936Additional Debug Info:com.thortech.xl.orb.dataaccess.tcDataAccessException
    at com.thortech.xl.dataaccess.tcDataAccessExceptionUtil.createException(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBase.createException(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataBase.readPartialStatement(Unknown Source)
    at com.thortech.xl.dataobj.tcDataBase.readPartialStatement(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataSet.executeQuery(Unknown Source)
    at com.thortech.xl.dataobj.tcDataSet.executeQuery(Unknown Source)
    at com.thortech.xl.dataaccess.tcDataSet.executeQuery(Unknown Source)
    at com.thortech.xl.dataobj.tcDataSet.executeQuery(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.getChildTableFieldValue(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.getRunTimeValue(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.getRunTimeValue(Unknown Source)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpADDUSERTOADGROUP.implementation(adpADDUSERTOADGROUP.java:49)
    at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.insertResponseMilestones(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.updateSchItem(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.finalizeProcessAdapter(Unknown Source)
    at com.thortech.xl.adapterfactory.events.tcAdpEvent.finalizeAdapter(Unknown Source)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpCREATEADUSER.implementation(adpCREATEADUSER.java:85)
    at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcORC.insertNonConditionalMilestones(Unknown Source)
    at com.thortech.xl.dataobj.tcORC.completeSystemValidationMilestone(Unknown Source)
    at com.thortech.xl.dataobj.tcOrderItemInfo.completeCarrierBaseMilestone(Unknown Source)
    at com.thortech.xl.dataobj.tcOrderItemInfo.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcUDProcess.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(Unknown Source)
    at com.thortech.xl.ejb.beans.tcFormInstanceOperationsSession.setProcessFormData(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    at org.jboss.ejb.Container.invoke(Container.java:960)
    at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
    at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
    at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
    at $Proxy758.setProcessFormData(Unknown Source)
    at Thor.API.Operations.tcFormInstanceOperationsClient.setProcessFormData(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at Thor.API.Security.LoginHandler.jbossLoginSession.runAs(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy803.setProcessFormData(Unknown Source)
    at com.thortech.xl.webclient.actions.DirectProvisionUserAction.handleVerifyProcessData(Unknown Source)
    at com.thortech.xl.webclient.actions.DirectProvisionUserAction.goNext(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
    at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(Unknown Source)
    at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source)
    at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown Source)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
    at java.lang.Thread.run(Thread.java:619)
    Thanks,
    Hemant

    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpADDUSERTOADGROUP.implementation(adpADDUSERTOADGROUP.java:49)
    This is definitely a Custom Adapter because OOTB Adapter name is adpADCSADDUSERTOGROUP and NOT adpADDUSERTOADGROUP
    So, it is your custom code and in the code you are passing incorrect value of the Active Directory Child process form...
    The correct name is UD_ADUSRC and the Group Name column name is UD_ADUSRC_GROUPNAME.
    While you are passing UD_AD_CHILD as the child process form and UD_AD_CHILD_GRP_NAME as Group Name column name..
    Use OOTB Adapter... Correct these discrepancies... Your addition of group will work
    And since you are creating custom adapter, you need to be more careful and remain consistent throughout..
    Then if you want to use UD_AD_CHILD_GRP_NAME, use it everywhere consistently... Pass only this value in the adapter...
    And even in lookups, if any... Search everywhere... Keep things consistent... They will work... Because good news is that you are able to create user in AD via Java Code...
    And if any post is even slightly helpful, it is a good habit to mark it with helpful or correct ... And also mark the entire question as answered so that other people also are benefited.

  • Need Help creating new user in Active Directory

    I am trying to create a new user in active directory via a java application. I have included the code that I am using. I am able to successfully bind to Active Directory. I have been able to change passwords, and delete users, but I have not been able to create a user.
    ldapHost : "mta101.DOM101.CEL.ACC.AF.MIL"
    domainName: "dc=dom101,dc=cel,dc=acc,dc=af,dc=mil"
    existing account: CN=Brett K. Humpherys,OU=Users,OU=CEL
    I get the following error on the createSubcontext statement:
    javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21 - 00000057: LdapErr: DSID-0C09098B, comment: Error in attribute conversion operation, data 0, v893 ; remaining name 'CN=test1,OU=Users,OU=CEL'
    I have commented out the password portion and change the ObjectCategory to a 32 and get the same error.
        public GblStatus createAccount7(DbaDb dbConn,
                                        String jsrcName,
                                        String personName,
                                        String username,
                                        String password)
          Hashtable ldapEnv = new Hashtable(11);
          ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
          ldapEnv.put(Context.PROVIDER_URL, "ldap://" + this.ldapHost + ":636");
          ldapEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
          ldapEnv.put(Context.SECURITY_PROTOCOL, "ssl");
          ldapEnv.put(Context.REFERRAL, "ignore");
          ldapEnv.put(Context.SECURITY_PRINCIPAL,"cn=" + this.adminAcct + ",cn=users," + this.domainName);
          ldapEnv.put(Context.SECURITY_CREDENTIALS, this.adminPwd);
           try
            // Create the initial context
            DirContext ctx = new InitialDirContext(ldapEnv);
            BasicAttributes attrs = new BasicAttributes();
            BasicAttribute ocs = new BasicAttribute("objectclass");
            ocs.add("top");
            ocs.add("person");
            ocs.add("organizationalPerson");
            ocs.add("user");
            attrs.put(ocs);
            BasicAttribute gn = new BasicAttribute("givenName", "test1");
            attrs.put(gn);
            BasicAttribute sn = new BasicAttribute("sn", "");
            attrs.put(sn);
            BasicAttribute cn = new BasicAttribute("cn", "test1");
            attrs.put(cn);
            BasicAttribute uac = new BasicAttribute("userAccountControl", "66048");
            attrs.put(uac);
            BasicAttribute sam = new BasicAttribute("sAMAccountName", "test1");
            attrs.put(sam);
            BasicAttribute disName = new BasicAttribute("displayName", "test1");
            attrs.put(disName);
            BasicAttribute userPrincipalName = new BasicAttribute
                                          ("userPrincipalName", "[email protected]");
            attrs.put(userPrincipalName);
            BasicAttribute instanceType = new BasicAttribute("instanceType", "4");
            attrs.put(instanceType);
            BasicAttribute objectCategory = new BasicAttribute
                      ("objectCategory","CN=User,CN=Schema,CN=Configuration," + domainName);
            attrs.put(objectCategory);
            String newVal = new String("\"password\"");
            byte _bytes[] = newVal.getBytes("Unicode");
    byte bytes[] = new byte[_bytes.length - 2];
    System.arraycopy(_bytes, 2, bytes, 0, _bytes.length - 2);
    BasicAttribute attribute = new BasicAttribute("unicodePwd");
    attribute.add((byte[]) bytes);
    attrs.put(attribute);
    ctx.createSubcontext("CN=test1,OU=Users,OU=CEL", attrs);
    ctx.close();
    catch (NameAlreadyBoundException nex)
    System.out.println("User ID is already in use, please select a different user ID ...");
    catch (Exception ex)
    System.out.println("Failed to create user account... Please verify the user information...");
    ex.printStackTrace();
    return new GblStatus();
    Any help would be much appreciated.

    Hi .,
    me too got up with same problem., can anyone help me.??
    Someone help me to create attributes in AD using LDAP
    package LDAPpack;
    import javax.naming.*;
    import javax.naming.directory.*;
    import javax.naming.ldap.InitialLdapContext;
    import javax.naming.ldap.LdapContext;
    import java.util.Hashtable;
    class CreateAttrs {
    public static void main(String[] args) {
         Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, "ldap://10.242.6.166:389/");
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL, "CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org");
                        env.put(Context.SECURITY_CREDENTIALS, "password-1");
              LdapContext ctx =null;
              try {
                   //ctx = new InitialLdapContext(env,null);
                   try {
    ctx = new InitialLdapContext(env,null);
                   catch(NamingException e) {
    System.out.println("Login failed");
    System.exit(0);
    if(ctx!=null){              
    System.out.println("Login Successful");
    byte[] buf = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; // same data
         // Create a multivalued attribute with 4 String values
         BasicAttribute oc = new BasicAttribute("objectClassNew", "topNew");
         oc.add("personNew");
         oc.add("organizationalPersonNew");
         // Create an attribute with a byte array
         BasicAttribute photo = new BasicAttribute("jpegPhotoNew", buf);
         // Create attribute set
         BasicAttributes attrs = new BasicAttributes(true);
         attrs.put(oc);
         attrs.put(photo);
         Attributes attrs1 = ctx.getAttributes("CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org");
    System.out.println(attrs1);
    Context result = ctx.createSubcontext("CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org", attrs);
    //i got error here; i attach the error below.
         ctx.close();
    System.out.println("close");
         catch(NamingException e){
              e.printStackTrace();
    ERROR:
    Login Successful
    javax.naming.directory.NoSuchAttributeException: [LDAP: error code 16 - 00000057: LdapErr: DSID-0C090B38, comment: Error in attribute conversion operation, data 0, vece
    ANYONE HELP ME PLS.
    Edited by: vencer on Jun 19, 2008 12:38 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem Creating Oracle Schema in Active Directory

    Hi,
    I am trying to integrate oracle 9i in an Microsoft Active directory domain
    I tried to integrate the db in the domain using net configuration assistant on the Oracle Client but
    I get always the same error after inserting the fully name of domain controller and confirm to create the oracle schema. The error I get is:
    “The Assistant is unable to create or update
    the schema for the following reason:
    ConfigException: Could not create Oracle schema oracle.net.config.ConfigException
    You must update the schema from a computer which directly supports
    your type of directory."
    Also I checked every requirement to install:
    -Log on as an Administrative account in the domain
    -Enable active directory schema changes
    -ping the whole dns domain, the fqdn of my domain controller is dc.ecm.com, I can:
    ping dc.ecm.oracle
    At this point I don’t know anymore what I can do.
    Please help me
    Thank you in advance
    Fahim Ghauri

    Take a look at metalink Note:361192.1
    Bug 3975572 - "...Netca 10g can successfully create a schema and context in W2k but does not in W2003. This reproduces on both the domain server and a client..."

  • How to create an OracleContext in Active Directory ?

    Hi all,
    I just installed Oracle Application Server 10g (9.0.4) on a Windows running Active Directory. I would like to demonstrate AD capability to manage Enterprise User Security (as OID is capable of).
    When I run Net Configuration Assistant to setup Directory Usage for Active Directory, it can read AD because it gives a message telling that OracleContext has to be created. So, it ask me for a "User DN" and a password.
    I have tried all possibilities I could thing of to get connected but none of them work.
    The most obvious DN I tried was: cn=Administrator,cn=Users,dc=lab,dc=test (for my lab.test domain).
    I get "Authentication error", "Unkown error" but could get through it.
    Does anybody gone through this yet ?
    Thanks a lot for help out

    Answer provided by Oracle Support:
    " You cannot use AD directly for authentication. You need one OID/ OVD in the middle. AD cannot be used directly for Enterprise User Security. "

  • Delete local accounts created when logging into Active Directory?

    When a user logs into their Mac using their Active Directory credentials, a new local user folder is created that corresponds to their login name. But a new account doesn't show up in the System Preferences Accounts. So how do I go about deleting this local account? Can I simply delete their Users folder?
    Thanks.
    G4 (model M8839LL/A)   Mac OS X (10.4.8)  

    AD does this with Windows, too. This is because the AD account is not the same as the local account. If you have a user with the username joeuser, and he has a local account named joeuser, he'll have a home directory in that name. If he logs into and AD system with the domain name ADDomain, there will then be an account with a name something like joeuser.ADDOMAIN, which, by definition, is not the same as the account joeuser. On a Windows box, at the same time as the joeuser.ADDOMAIN account is created the joeuser account will have its name changed; if the box's name is joe's_mac, the joeuser account will become joeuser.JOE'S_MAC. This kind of thing will apply only to users who have both local and domain accounts. Users who have only local accounts, such as jilluser, will not have their account name changed. Users who have only domain accounts, such as bobdomain, will not have their account name changed. Users will not notice any difference in the way they log in; they will log into their domain account, and see just what that account has access to, or will log into their local account, and see just what that local account has acces too, depending only on how they set the login box. They will never have to enter joeuser.ADDOMAIN, just joeuser... and the domain name in the proper place.
    If you delete the domain account, a new one will be automatically generated as soon as the user logs back in using a domain account. Any data stored in that account will be deleted when you delete the account.

  • Step by step process to create domain name and active directory in windows 7 64 bit

    Step by step process to create domain and active directory in windows 7 64 bit
    I work in an organization
    I want to create a domain name SBBYDP and make it server for other computers
    I want that, all users’ have a personal account while they use any computer from this organization, even they use any computer from this network they use their own account to login to network.
    And this may be in Active directory option.
    I installed windows 7 professional edition 64 bit
    Can any person help me? Step by step process, I always thanks full all of you

    Hi,
    You must use the Windows Server platform system for the AD service, you can refer the following KB first:
    Active Directory
    http://technet.microsoft.com/en-us/library/bb742424.aspx
    AD DS Deployment Guide
    http://technet.microsoft.com/zh-cn/library/cc753963(v=ws.10).aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Using Flash to create visual representation of Active Directory

    Hi, I would like to know if anyone know how to do this? Basically, I have floorplans of the various sites that our company uses. i have made these floorplans vectors, and can be used in flash. the floor plans are quite detailed, with desks included. What I would like is some integration with Active directory, where i can have a visual picture of computers populating the various floorplans, but the population of this is driven by the active directory. so computer names and user names would be visable in this dynamic visual representation. I saw an article on the microsoft site, how to do just this with viso 2007, but wondering if i can do this with flash. any ideas?

    Hi,
    Yes it is possible. Basically just few things are required to go ahead
    1. need to understand Flash LoadVars
    2. In ASP, you need to know how to connect to and run SQL against the database
    There is a thread that talks about how flash can load variables from an ASP script may help you
    http://actionscript.org/forums/showthread.php3?t=67379
    Thanks!
    ps: please mark this thread as Answered if this is of help to you.

  • How do I create a user in active directory?

    I've been trying to figure this out and found some tutorials online. I am getting this error:
    javax.naming.directory.NoSuchAttributeException: [LDAP: error code 16 - 00000057: LdapErr: DSID-0C090C26, comment: Error in attribute conversion operation, data 0, v1771
    From this code:
    try
                   String userType = user.getUserType() + "s (dural)";
                   LOG.debug("user type is " + userType);
                   String groupName = "Thin Client Users";
                   Attributes attrs = new BasicAttributes(true);
                   attrs.put("objectClass", userType);
                   attrs.put("samAccountName", user.getWindowsId());
                   attrs.put("cn", user.getCommentString());
                   attrs.put("givenName", user.getFirstName());
                   attrs.put("sn", user.getLastName());
                   attrs.put("displayName", user.getCommentString());
                   String userName = String.format(
                             "CN=%s,OU=Staff,OU=%s,DC=elandata,DC=com",
                             user.getCommentString(), user.getUserType());
                   int UF_ACCOUNTDISABLE = 0x0002;
                   int UF_PASSWD_NOTREQD = 0x0020;
                   int UF_PASSWD_CANT_CHANGE = 0x0040;
                   int UF_NORMAL_ACCOUNT = 0x0200;
                   int UF_DONT_EXPIRE_PASSWD = 0x10000;
                   int UF_PASSWORD_EXPIRED = 0x800000;
                   attrs.put(
                             "userAccountControl",
                             Integer.toString(UF_NORMAL_ACCOUNT + UF_PASSWD_NOTREQD
                                       + UF_PASSWORD_EXPIRED + UF_ACCOUNTDISABLE));
                   Context result = ctxGC.createSubcontext(userName, attrs);
                   LOG.info("Creating windows account for: " + userName);
                   StartTlsResponse tls = (StartTlsResponse) ctxGC
                             .extendedOperation(new StartTlsRequest());
                   tls.negotiate();
                   ModificationItem[] mods = new ModificationItem[2];
                   String newQuotedPassword = "\"password\"";
                   byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
                   mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
                             new BasicAttribute("unicodePwd", newUnicodePassword));
                   mods[1] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
                             new BasicAttribute("userAccountControl",
                                       Integer.toString(UF_NORMAL_ACCOUNT
                                                 + UF_PASSWORD_EXPIRED)));
                   ctxGC.modifyAttributes(userName, mods);
                   LOG.info("Set password & updated userccountControl");
                   try
                        ModificationItem member[] = new ModificationItem[1];
                        member[0] = new ModificationItem(DirContext.ADD_ATTRIBUTE,
                                  new BasicAttribute("member", userName));
                        ctxGC.modifyAttributes(groupName, member);
                        System.out.println("Added user to group: " + groupName);
                   } catch (NamingException e)
                        System.err.println("Problem adding user to group: " + e);
                   // Could have put tls.close() prior to the group modification
                   // but it seems to screw up the connection or context ?
                   tls.close();
                   ctxGC.close();
    I've tried commenting out the "unicodePwd" attribute since I can't find it on microsoft's website, but still same error.

    Are you getting it when creating the subcontext or when modifying the attributes?
    And why are you doing that in two steps? Why not just set all the attributes you need before creating the subcontext?
    And is there any clue in the exception as to which attribute is wrong?
    And have you tried commenting out the attributes one by one to see which it is?

  • How do you find who created a user in Active Directory?

    I think it would be almost impossible to tell who created an individual AD record, as in my experience there is generally only 1 Domain Admin account for which to create users. 

    So I've done some research and have found LDAP queries that will tell me when a user is created, but not necessarily who created the user. The reason I am asking is because I ran an audit of active and inactive users and between my boss and I (we are a small company so we know all the users) we could not figure out who some of the users were. Thanks for your help!
    This topic first appeared in the Spiceworks Community

  • Creating users in Microsoft Active Directory 2000/2003 with password.

    Our BSP application is using LDAP_CREATE function module to create users in Microsoft AD 2000 and 2003. But the users are not created along with passwords. without passwords the users are created in disabled mode.
    We tried using the SAP provided function modules under function group SLDAP to create the entries. We are able to create accounts on MSADS but only without the password. We find that MSADS requires the password to be passed/sent as a bytecode array (SAP equivalent Xstring/Rawstring ?) under the attribute unicodePwd, which we did using the fn. module LDAP_CREATE.
    But the server returns an error code LDAPRC053 which translates to "Unable to execute operation on the server".
    We generate the password string and convert the same into an xstring using SCMS_TEXT_TO_XSTRING function module.
    We are not sure what we are missing, but the account does not get created with the password at all. Would appreciate if you can help.
    We do have a backup solution of creating the users offline, but I want persue in above mentioned direction. Anybody has resolved this issue? Please let me know.
    Thanks in advance.

    I'm suspecting it has something to do with calling the function over an open connection versus a secure connection, SSL on port 636.
    Any comments ?

  • Creating a windows user in Active Directory

    I am trying to create a user in Active Directory that can log on as any other Windows user, but when I try to log into Windows, I get the following error message:
    "The local policy of this system does not allow you to logon interactively".
    Are there any attributes or objectclass settings that must be set for the user to allow interactive logons?
    Thanks in advance!

    This has nothing to do with JNDI, the object class or attributes.
    I assume that you are trying to logon locally to the domain controller with the new user that you have just created.
    By default, the domain controller's policy only allows specific users or members of a group to logon locally at the domain domain controller's console.
    Either edit the domain controller'sgroup policy and add your newly created user to the list of users permitted to logon locally, or add the user to a group which has already been granted permission to logon locally.

  • How to create user in Active directory

    Hello,
    I'm trying to create a user in active directory via the following example:
    String userName = "cn=Jef Klak,ou=Ps Users,ou=Users,ou=Managed,dc=xxx,dc=local";
         Attributes attrs = new BasicAttributes(false);
         Attribute oc = new BasicAttribute("objectClass");
         oc.add("top");
         oc.add("person");
         oc.add("organizationalPerson");
         oc.add("user");
         attrs.put(oc);
              attrs.put("cn","Jef Klak");
              attrs.put("giveName","Jef");
              attrs.put("sn","Klak");
              attrs.put("displayName","Klak, Jef");
              attrs.put("description","IR");
              attrs.put("userPrincipalName","[email protected]");
              attrs.put("mail","[email protected]");
              attrs.put("company", "XXX");
              attrs.put("sAMAccountName","jk666");
    attrs.put("userAccountControl",Integer.toString(UF_NORMAL_ACCOUNT + UF_DONT_EXPIRE_PASSWD+ UF_ACCOUNTDISABLE));
              Context result = fctx.createSubcontext(userName, attrs);
    As a result I'm getting the following error:
    javax.naming.directory.NoSuchAttributeException: [LDAP: error code 16 - 00000057: LdapErr: DSID-0C090B38, comment: Error in attribute conversion operation, data 0, vece
    remaining name 'cn=Jef Klak,ou=Ps Users,ou=Users,ou=Managed,dc=xxx,dc=local'
    Anybody any tips or advice on this one? Or maybe a working examples how to add users in AD?
    Listing entries in the AD is no problem, so it's only adding them.
    Many thanks,
    Filip                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

              attrs.put("giveName","Jef");
    javax.naming.directory.NoSuchAttributeExceptionSpelling error.

Maybe you are looking for

  • How do I get my gmail account to show up in my emil accounts under mail

    I've now opened up a new gmail account since I'm going to possibly change Internet service providers. I've had my current provider for a LONG Time and I'm not looking forward to making changes, but money talks. When open up my mail now all my account

  • How can I update my iphone from ios 6 beta to the regular ios 6?

    I currently have IOS 6 beta 4 and iTunes nor my phone will allow me to update. I want the additional features that were added. HELP!!!

  • How to get the first and second quarter from CRT

    Dear Freinds,                 I have one scenario , the Functional SPEC says Read the payroll results and from the CRT  get all the 4 quaters for the wage type /5UH  and sum them and then pass on the to field in the main strucutre. Iam using the FM H

  • Booting MBP HDD as an External to a PC

    So it finally happened... the magsafe power cord failed to do its job (really I just wasn't being careful enough) and got snagged. End rsult, my MBP is now rendered fairly useless. It will turn on, but stays on the boot screen and then flashes the fo

  • Zen MX Causes "USB Hardware has Malfunctioned" Msg from Windows Xp

    MZen MX Causes "USB Hardware has Malfunctioned" Msg from Windows XpKNew? guy here. I have a THREE MONTH OLD Zen Mx 6gb. I noteced the past several weeks on playback it has started to "miss" or "hiccup" while playinmg back songs. Annoying. NOW, when I