Searching LDAP

I am trying to search LDAP for email addresses but am getting a javax.naming.NameNotFoundException when I know that the name I am using exists. Here is my code:
Hashtable hashtableEnvironment = new Hashtable();
     hashtableEnvironment.put(
Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory"
     hashtableEnvironment.put(
Context.PROVIDER_URL,
"ldap://LDAP.SERVER:389/o=organization"
     try {
     // Create the initial context
     InitialDirContext context = new InitialDirContext(hashtableEnvironment);
          String[] attrIDs = {"cn,email"};
          SearchControls ctls = new SearchControls();
          ctls.setReturningAttributes(attrIDs);
     NamingEnumeration ne = context.search("o=City of Vancouver", "cn=Darrin", ctls);
          while (ne.hasMore())
               System.out.println((String)ne.next());
I very much appreciate the help if anyone sees something obvious that I am doing wrong here.

That depends on how your entry is stored in the LDAP server. So do you have a entry with dn:
cn=Darrin,o=City of Vancouver,o=organization
in your directory?
Try using some simple free Java tool to access your directory, such as downloading LDAP browser from
http://www.iit.edu/~gawojar/ldap/
I found the above tool helps alot when I developing LDAP programs.
--lichu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Search LDAP

    Dear All,
    I want to search ldap in CM6
    I am using the following credentials:
    ldapServer = "192.168.1.100";
    ldapsearchbase = "ou=users, o=cisco.com";
    ldapPort = 8443;
    ldapUserId = "cn=Directory Manager, o=cisco.com";
    ldapPassword = "cisco";
    rootDn = "o=cisco.com";
    And I am getting the following error:
    Problem looking up name:javax.naming.ServiceUnavailableException: 192.168.1.100:8443; socket closed
    can u help me in this?
    Thanks alot.

    There's no LDAP in CCM5+. All data is now stored in the SQL database so you need to use AXL's executeSQLQuery. Since you need to know the structure of the database to make your query, the following page contains various Data Dictionary files.. a Data Dictionary is the database schema.
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_programming_reference_guides_list.html

  • Novell eDirectory Target Recon: Unable to search LDAP LDAP: error code 53

    Hi All,
    I am getting following error while running the Novell eDirectory Target Reconciliation in batch mode:
    *ERROR,27 Oct 2009 22:59:54,263,[XL_INTG.EDIRECTORY],Paged Search failed.javax.naming.OperationNotSupportedException: [LDAP: error code 53 - Unwilling To Perform]; remaining name 'ou=centrica,ou=Regular,o=Infosys'*
    *DEBUG,27 Oct 2009 22:59:54,263,[XL_INTG.EDIRECTORY],tcUtilLDAPOperations -> ~~~~~~~~~~Entering disconnectFromLDAP()~~~~~~~~~~*
    *DEBUG,27 Oct 2009 22:59:54,263,[XL_INTG.EDIRECTORY],tcUtilLDAPOperations -> Closing initial directory context*
    *DEBUG,27 Oct 2009 22:59:54,263,[XL_INTG.EDIRECTORY],tcUtilLDAPOperations -> ~~~~~~~~~~Leaving disconnectFromLDAP()~~~~~~~~~~*
    *ERROR,27 Oct 2009 22:59:54,263,[XL_INTG.EDIRECTORY],tcTskLDAPUserReconciliation] --> execute(): failed. Exception in execute() method.*
    *javax.naming.NamingException: tcUtilLDAPOperations  -> : NamingException : Unable to search LDAP [[LDAP: error code 53 - Unwilling To Perform]]*
    *     at com.thortech.xl.integration.ldap.util.tcUtilLDAPOperations.search(Unknown Source)*
    *     at com.thortech.xl.util.schedule.tasks.tcTskLDAPUserReconciliation.processChange(tcTskLDAPUserReconciliation.java:2752)*
    *     at com.thortech.xl.util.schedule.tasks.tcTskLDAPUserReconciliation.execute(tcTskLDAPUserReconciliation.java:344)*
    *     at com.thortech.xl.scheduler.tasks.SchedulerBaseTask.run(Unknown Source)*
    *     at com.thortech.xl.scheduler.core.quartz.QuartzWrapper$TaskExecutionAction.run(Unknown Source)*
    *     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)*
    *     at weblogic.security.service.SecurityManager.runAs(Unknown Source)*
    *     at weblogic.security.Security.runAs(Security.java:41)*
    *     at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)*
    *     at com.thortech.xl.scheduler.core.quartz.QuartzWrapper.execute(Unknown Source)*
    *     at org.quartz.core.JobRunShell.run(JobRunShell.java:178)*
    *     at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:477)*
    *DEBUG,27 Oct 2009 22:59:54,264,[XL_INTG.EDIRECTORY],tcTskLDAPUserReconciliation] --> execute(): exit*
    This error is coming only for OU's which have more than 200 entries in them. The
    if anyone has any clue on this problem, then kindly help.
    Cheers,
    Sunny

    See if your e-directory supports paged searches.
    If not then you have to configure your e-directory to support paged searches. I think the connector by default only uses paged searches.
    You need to look for OID 1.2.840.113556.1.4.319 (page control) in supported control list of the rootDSE.
    Hope this helps,
    Sagar

  • Address Book wildcard searching LDAP

    With Address Book under Mac OS X 10.4 (Tiger), and 10.5 (Leopard) it was possible to do a wildcard search of an LDAP server for contacts. You did this by typing *. or ** in the search box in the top right.
    Unfortunately, this no longer seems to work in Address Book in Mac OS X 10.6 (Snow Leopard).
    Does anyone know of an alternative way of doing this?

    Do you use iCloud? If so, try going to the System Preferences then iCloud and unchecking Contacts. It will warn you about deleting the contacts from your Mac. If you know your other devices on iCloud have the correct contacts(or icloud.com) then this should be completely safe. Once you've okayed them to be removed, immediately recheck contacts.
    Please let me know if this works. Thanks!
    Autumn

  • Searching LDAP attributes after Authentication

    All,
    Thanks to Tyler Muth's blog posting on Secure LDAP, I have been able to get authentication working with our SunOne LDAP using a custom authentication scheme. Apex does not natively support SSL authentication where you have to use a secure bind to LDAP with a service DN (which has its own service userID and password) before passing on username, password of the actual user.
    Now I am trying to retrieve attributes on that authenticated user -- attributes that are in the LDAP directory like, department, title, etc. Does anyone have some suggestions -- code examples would be great? I looked at the example in Pro Application Express book but what confuses me is how do you pass the username that you already have from the authentication back to a function call to do the 'dbms_ldap.search'. The authentication function closes the LDAP session once the user is authenticated. So now I am in the application with that 'APP_USER'. I believe I now have to do the following steps but not sure how to accomplish them:
    1.) I need to re-open an LDAP session ( I assume I still will need to re-bind with LDAP using my service Dn and service password as in the custom Auth that was just done).
    2.) I need to pass to the LDAP search the current 'APP_USER and start retrieving the other attributes-- our LDAP admin says that I can perform the search on that 'UID" as it is in our LDAP store.
    3.) There is code on a custom LDAPQuery function (built on dbms_ldap.search) in "Pro Oracle App Express" but it sends the data to a table and then does a query on the table to retrieve attributes.
    The code in "Pro App Express" does not require that initial Service DN (service username, password) secure bind (assigned to me by our LDAP admin). It looks like it is assuming the binding user is the user whose attributes are sent in the LDAPQuery function call (user and password parameters), but that is not the case in my situation. I want to query based on the currently logged in 'APP_USER' and retrieve attribute data into Form input items on the page the user has just authenticated into.
    Any help would be appreciated -- especially if you have done this already and have some sample code!
    Thanks,
    Pat

    Hi, Shijesh,
    I first wanted to test out the LDAP search outside of Apex and tried the following anonymous block:
    Declare
    retval PLS_INTEGER;
    l_dn VARCHAR2(1000);
    l_session DBMS_LDAP.session;
    l_attrs DBMS_LDAP.string_collection;
    l_message DBMS_LDAP.message;
    l_entry DBMS_LDAP.message;
    l_attr_name VARCHAR2(256);
    l_vals DBMS_LDAP.string_collection;
    l_ber_elmt DBMS_LDAP.ber_element;
    begin
    ---next 3 lines were set to be exactly same as used in my LDAP authentication which works fine with pre-defined global for host and port
    ---I put my own UID in for 'user_id'
    l_session := dbms_ldap.init(ldap_globals.g_host, ldap_globals.g_port);
    retval := DBMS_LDAP.open_ssl(l_session,'file:/var/opt/ORACLE/wallet_location','wallet_pswd',2);
    retval := dbms_ldap.simple_bind_s( l_session, 'ldab_admin_user', 'admin_pswd')
    l_attrs := 'ndtitle, title,nddepartment';
    retval := dbms_ldap.search_s( l_session ,
    ldap_globals.g_search_base,
    dbms_ldap.scope_subtree ,
    '(uid=user_id)',
    l_attrs ,
    0 ,
    l_message);
    l_entry := dbms_ldap.first_entry( l_session , l_message);
    l_dn := dbms_ldap.get_dn( l_session , l_entry);
    l_attr_name := dbms_ldap.first_attribute(l_session , l_entry , l_ber_elmt);
    dbms_output.put_line ('Attribute:' || l_attr_name) ;
    l_vals := dbms_ldap.get_values( l_session , l_entry , l_attr_name);
    dbms_output.put_line('Value:' || l_vals(0));
    l_attr_name := dbms_ldap.next_attribute(l_session , l_entry , l_ber_elmt);
    dbms_output.put_line ('Attribute:' || l_attr_name) ;
    l_vals := dbms_ldap.get_values( l_session , l_entry , l_attr_name);
    dbms_output.put_line('Value:' || l_vals(0));
    l_attr_name := dbms_ldap.next_attribute(l_session , l_entry , l_ber_elmt);
    dbms_output.put_line ('Attribute:' || l_attr_name) ;
    l_vals := dbms_ldap.get_values( l_session , l_entry , l_attr_name);
    dbms_output.put_line('Value:' || l_vals(0));
    retval := dbms_ldap.unbind_s( l_session );
    end;
    I get the following error which is pointing to the line with my 'dbms_ldap.simple_bind_s' which was copied exactly from my authentication function which works.
    ORA-06550: line 15, column 14:
    PLS-00382: expression is of wrong type
    ORA-06550: line 15, column 3:
    PL/SQL: Statement ignored
    Do you see what might be causing the error?
    Thanks,
    Pat

  • Search LDAP for Org Data

    I already wrote a code to find each attribute on LDAP. How can I find everyone who is under a manager in LDAP?
    For example, I enter 'John.Doe' and I would like the results to be everyone reporting to him and everyone below him in the org.
    Thanks.

    If you are using Active Directory, then you can just perform a search for users who have the value of John Smith in their manager's attribute. For example:...
    String searchFilter = "(&(objectClass=user)(manager=cn=John Smith,ou=Sales,dc=antipodes,dc=com))";
    ...And just for the hell of it, I posted a topic titled "JNDI, Active Directory, Attribute Scoped Queries" at http://forum.java.sun.com/thread.jspa?threadID=5142804&tstart=0 that describes the two different mechanisms that can be used to search for objects that are defined with linked attributes, such as users connected via their manager & directReports attribute, users and groups connected via their member & memberOf attribute.
    And if you aren't using Active Directory.......speak to your Microsoft Sales rep !

  • Messaging Server (sharing folder) searching LDAP is not indexed, why?

    There's an feature of "sharing a mail folder"
    in JMS (Java Messaging Server), whereby
    a user could share a folder with another user.
    But when a user (uid) is entered into
    the "Admission List" box, and the Add button
    is pressed, it failed with some error messages
    Invalid user and Admin Limit exceeded.
    I've asked in the JMS forum and Shane said
    this:
    The "Administrative limit exceeded" error agrees with the Notes=U and etime=12 in the LDAP access log file. The problem is that the search is not indexed and therefore taking long enough to run foul of the timelimit. You will need to consult with Directory Server experts to determine why this search is not indexed and resolve that.
    Could someone enlighten me on what I've
    missed out when I've configured the Ldap
    server during my installation of the JES system

    Here are the extracts of the access and error logs when the "Add" button (after a uid was entered into the box) was clicked.
    Invalid user error line appeared on screen
    Error log:
    WARNING<20805> - Backend Database - search is not indexed base='o=bunet' filter='(&(&(mailUserStatus=active)(objectClass=inetmailuser)(mailHost=jsms.our.domain)(uid=cmtsang))(!(mgmanHidden=true)))' scope='sub'
    Access log:
    SRCH base="o=bunet" scope=2
    filter="(&(&(mailUserStatus=active)(objectClass=inetmailuser)
    (mailHost=netnet.our.top.domain)(uid=cmtsang))(!(mgmanHidden=true)))" attrs="cn mail sn telephoneNumber department"
    RESULT err=0 tag=101 nentries=1 etime=7 notes=U

  • Disabled AD users still showing in People Search - LDAP query already filtering

    We are running MOSS 2007 on Windows Server 2008 R2 Standard. In the past couple of weeks we have noticed that our disabled Active Directory users are no longer being removed from SharePoint. On my import connection I have an LDAP query of "(&(objectCategory=Person)(objectClass=User)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*ca)(sn=*)(department=*)(!(!givenName=*)))",
    which among other things is filtering out disabled users. This has been this way for 5 years now and always worked fine. Now it has stopped doing its job and I can't figure out why. I have performed a complete reindex of the search as well as multiple full
    profile imports all to now avail.
    Can anyone shed some light on this for me?
    TIA
    Sandra

    Create the filter in AD connection 
    Open Edit connection filters screen from that you can see Exclusion filter for users.
    In Exclusion filter for users enter the below values.
    Attribute : userAccountControls (Select from dropdown)
    Operator: Bit on Equal (Select from dropdown)
    Filter : 2
    Once you enter the required values click on Add button and it will show the
    below details in Exclusion filter for users.
    Do the full crawl after this. 
    Check for details
    http://support.microsoft.com/kb/827754?wa=wsignin1.0

  • Searching LDAP with space in name

    All,
    I'm trying to write a package utilizing DBMS_LDAP that will take in an exchange distribution list as a VarChar2 and return a semi-colon delimitted list of member e-mails. So far, everything seems to be going well (though I haven't tested this part of my code yet), but I see that if I have a distribution list that contains spaces in the name (as some of our distribution lists do) then this could present a problem. What's the best way to get around this? Is there a one-space wild-card I can use to substitute for spaces in my Filter criteria?
    I'm developing on Oracle 11g.
    Thanks.

    All,
    Apologies for the late reply, but I got pulled to other projects last week.
    @ rp0428,
    My version is 11.2.0.2.0
    @ Purvesh, How does this help me pass a variable that contains spaces into the filter parameter of dbms_ldap.search_s? Seems like you provided an answer, but to a completely different question.
    @Verreynne, et. al
    Example below:
    Assuming you have an Exchange distribution list called 'EXCHANGE DISIT LIST WITH SPACES'
    Declare
    LDAP_HOST varchar2(100) := 'LDAP.MYAWESOMEDOMAIN.COM';
    LDAP_PORT number(10,0) := 3268;
    LDAP_USER varchar2(100) :='MYACCOUNT';
    LDAP_PSSWD VARCHAR2(100) :='MYACCOUNTPW';
    LDAP_USR_BASE VARCHAR2(100) := 'DC=MYAWESOMEDOMAIN,DC=Com';
    L_SESSION DBMS_LDAP.SESSION;
    Msg DBMS_LDAP.MESSAGE;
    L_RETVAL PLS_INTEGER;
    L_FILTER CLOB := '(CN=EXCHANGE DISIT LIST WITH SPACES)'; --here is where I have the problem.  I need to somehow pass this to the filter parameter of DBMS_LDAP.Search_S and have Msg return a pointer to the entries that meet this criteria;
    L_ATTRS DBMS_LDAP.STRING_COLLECTION;
    L_VALUES DBMS_LDAP.STRING_COLLECTION;
    BEGIN
    L_SESSION := DBMS_LDAP.INIT(LDAP_HOST, LDAP_PORT);
    l_retval := DBMS_LDAP.SIMPLE_BIND_S(LD => L_SESSION,
    DN => LDAP_USER,
    PASSWD => LDAP_PSSWD);
    IF L_RETVAL = DBMS_LDAP.SUCCESS THEN
    L_ATTRS(0) := 'member';
    L_RETVAL := DBMS_LDAP.SEARCH_S(LD => L_SESSION,
    BASE => LDAP_USR_BASE,
    SCOPE => DBMS_LDAP.SCOPE_SUBTREE,
    FILTER => L_FILTER,
    ATTRS => L_ATTRS,
    ATTRONLY => 0,
    RES => MSG);
    IF L_RETVAL = DBMS_LDAP.SUCCESS THEN
    MSG := DBMS_LDAP.FIRST_ENTRY(L_SESSION, MSG);
    L_VALUES := DBMS_LDAP.GET_VALUES(L_SESSION, MSG, 'member');
    for i in L_VALUES.FIRST..L_VALUES.LAST LOOP
    dbms_output.put_line(L_VALUES(i));
    END LOOP;
    MSG := DBMS_LDAP.NEXT_ENTRY(L_SESSION, MSG);
    END IF;
    END IF;
    L_RETVAL := DBMS_LDAP.UNBIND_S(L_SESSION);
    END;
    I'm beginning to think that the answer to my problem is that I have to get all group entries (REPLACE(L_FILTER,' ','*')) and iterate through them all to somehow match against what I'm intending to filter. Is this the best approach for my issue? If I must go down that route, is there something similar to the '?' wild-card that I can use for DBMS_LDAP.SEARCH_S, or am I stuck with using '*' ?
    Thanks in advance.
    Edited by: 929933 on Aug 7, 2012 11:27 AM

  • LDAP sub tree search by OAM during authentication

    Hi,
    Is it possible to configure OAM to perform sub tree search for user id while authenticating a user. The scenario is - OAM is configured to search LDAP at level ou=comp, dc=com. User ID U01 is stored in ou=fin,ou=comp,dc=com.  When user logs in with user ID U01, will OAM search in sub tree level ou=fin,ou=comp,dc=com and not just under ou=comp, dc=com?

    Also, you can get more info at http://docs.oracle.com/cd/E27559_01/admin.1112/e27239/datasrc.htm#CHDIACJI URL with more description.
    ~J

  • LDAP - searching cached data

    Hi folks.
    I need to modify an existing application to integrate with an LDAP server. One of the things my code needs to do is search LDAP entries, using a search filter. For example:
    NamingEnumeration<SearchResult> results =
    ldapContext.search(LdapName,
    "(|(objectClass=group)",
    null);
    This works just fine. My problem is that we can't afford to hit the LDAP server every time this search needs to be run - it takes too long to get the results. So, we will periodically request all LDAP entries, and cache them locally.
    My code then needs to search the cached data, just as it would if it were making a request of the LDAP server. Ideally, I'd like to be able to use the same filter syntax as above when searching the local data.
    Is there a way to search locally cached data? Essentially, I want to run the search specified above, but instead of pointing the code at an LDAP server, I want to point it at locally cached data.
    Thanks!

    Hi folks.
    I need to modify an existing application to integrate with an LDAP server. One of the things my code needs to do is search LDAP entries, using a search filter. For example:
    NamingEnumeration<SearchResult> results =
    ldapContext.search(LdapName,
    "(|(objectClass=group)",
    null);
    This works just fine. My problem is that we can't afford to hit the LDAP server every time this search needs to be run - it takes too long to get the results. So, we will periodically request all LDAP entries, and cache them locally.
    My code then needs to search the cached data, just as it would if it were making a request of the LDAP server. Ideally, I'd like to be able to use the same filter syntax as above when searching the local data.
    Is there a way to search locally cached data? Essentially, I want to run the search specified above, but instead of pointing the code at an LDAP server, I want to point it at locally cached data.
    Thanks!

  • Help, Java newbie a little over my head with LDAP

    I'm actually a network admin but I've been dabling in Java for a little while now.
    I am trying to write an app that will allow me to insert and remove attributes to entries in Active Directory.
    I have found some sample code which I have altered to make a "proof of concept" before I start on the actuall app I want.
    The problem I am having is writing into the AD. I can query entries with no error but when I try a modification I get an "DSA is unwilling to perform" LDAPException. I am pretty sure it's not a permissions issue but from reading stuff on here I am begnining to think that it may have something to do with SSL connections. There is commented out code below where I experimented with this but I was unable to connect the the AD when this was in. "unable to connect to the directory server error".
    If anyone can offer me any advice I would be most grateful.
    package LDAPTest;
    import netscape.ldap.*;
    import java.util.*;
    import com.novell.service.ndssdk.jndi.ldap.ssl.*;
    // Simple program to experiment with searching LDAP
    public class FilterSearch
    public static void main(String[] args)
    if(args.length != 6)
    System.out.println("Usage: java FilterSearch " +
    "<host> <port> "+
    "<authdn> <password> "+
    "<basedn> <filter> ");
    System.exit(1);
    String host = args[0];
    int port = Integer.parseInt(args[1]);
    String authid = args[2];
    String authpw = args[3];
    String base = args[4];
    String filter = args[5];
    String[] ATTRS = {"memberOf"};
    int status = -1;
    //SSL experiment that would not connect to the AD server.
    //LDAPConnection ld = new LDAPConnection(new LDAPSSLSocketFactory("com.novell.service.ndssdk.jndi.ldap.ssl.LdapSecureSocketFactory"));
    LDAPConnection ld = new LDAPConnection();
    System.out.println("done connection");
    try
    //Connect to server and authenticate
    ld.connect(host, port,authid,authpw);
    System.out.println("Search filter = " +filter);
    LDAPSearchResults res = ld.search(base, ld.SCOPE_SUB, filter, null, false);
    //Loop on results until complete
    while(res.hasMoreElements())
    try
    //Next Directory entry
    LDAPEntry entry = res.next();
    prettyPrint(entry, ATTRS, ld);
    status=0;
    catch(LDAPReferralException e)
    System.out.println(e);
    continue;
    catch(LDAPException e)
    System.out.println(e.toString() );
    continue;
    LDAPAttribute atrib = new LDAPAttribute("memberOf", "CN=Tight VNC,OU=Staging Transmitter Channels,DC=marimba,DC=local");
    LDAPModification mod = new LDAPModification(LDAPModification.ADD, atrib);
    System.out.println(ld.isAuthenticated());
    try{
    // This is the code the throws the Exception DSA is unwilling to perform.
    ld.modify("CN=smstest0005,CN=MarimbaComputers,CN=Computers,DC=marimba,DC=local", mod);}
    catch(LDAPException e){
    System.out.println(e);}
    catch(LDAPException e)
    System.out.println(e.toString() );
    //Done, so disconnect
    if((ld!=null) && (ld.isConnected()))
    try
    ld.disconnect();
    catch(LDAPException e)
    System.out.println(e.toString());
    System.exit(status);
    public static void prettyPrint(LDAPEntry entry, String[] attrs, LDAPConnection ld)
    System.out.println("DN: " + entry.getDN());
    //Use array to pick attributes. We could have
    //enumerated them all user LDAPEntry.getAttributes
    //but this gives us control of the display order
    for(int i = 0; i < attrs.length; i++)
    LDAPAttribute attr = entry.getAttribute( attrs);
    if (attr == null )
    System.out.println(attrs[i] + " not present");
    continue;
    Enumeration enumVals = attr.getStringValues();
    //Enumerate on values for this attribute
    boolean hasVals = false;
    while ((enumVals!=null) && enumVals.hasMoreElements())
    String val = (String)enumVals.nextElement();
    System.out.println(attrs[i] + ": " + val);
    hasVals=true;
    if(!hasVals)
    System.out.println(attrs[i] + " has no values");
    System.out.println("----------------------");

    OK, I have learned a little about JNDI today and have attempted to implement this using JNDI instead.
    I am now getting the OperationNotSupportedException when attempting to add an attribute to an item in Active Directory.
    here's the code, can anybody who has managed to add data into AD help with this?
    cheers.
    package JNDI;
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.*;
    class Getattr
    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://hostname:389/");
    env.put(Context.SECURITY_PRINCIPAL, args[0]);
    env.put(Context.SECURITY_CREDENTIALS, args[1]);
    try {
    // Create the initial directory context
    DirContext ctx = new InitialDirContext(env);
    // Ask for all attributes of the object
    Attributes attrs = ctx.getAttributes("CN=smstest0005,CN=MarimbaComputers,CN=Computers,DC=marimba,DC=local");
    for (NamingEnumeration ae = attrs.getAll(); ae.hasMore();)
    Attribute attr = (Attribute)ae.next();
    System.out.println("attribute: " + attr.getID());
    /* Print each value */
    for (NamingEnumeration e = attr.getAll(); e.hasMore();System.out.println("value: " + e.next()));
    // Specify the changes to make
    ModificationItem mod[] = new ModificationItem[1];
    mod[0] = new ModificationItem(DirContext.ADD_ATTRIBUTE,
    new BasicAttribute("memberOf", "CN=Tight VNC,OU=Staging Transmitter Channels,DC=marimba,DC=local"));
    ctx.modifyAttributes("CN=smstest0005,CN=MarimbaComputers,CN=Computers,DC=marimba,DC=local", mod);
    // Find the surname attribute ("memberOf") and print it
    //System.out.println("memberOf: " + attrs.get("memberOf").get());
    } catch (NamingException e) {
    System.err.println("Problem getting attribute:" + e);

  • LDAP lookup in Calendar?

    Does Calendar have the capability to search LDAP when I'm trying to add someone in the invite?

    You can change the password on the account, and change the ASA configuration straight after you change the password.
    For those who are already connected via VPN, they will not be affected. For those who are trying to connect at the same time will be affected while password is being changed.
    However, as soon as the password is changed on your account, you can change the ASA configuration to reflect the new password and tested the account via the ASA test tool to make sure that the new password is authenticating correctly, and that should be all.
    Hope that makes sense.

  • Too many simultaneous persistent searches

    The Access Manager (2005Q1) in our deployment talks to load-balanced Directory Server instances and as recommended by Sun we have set the value of the property com.sun.am.event.connection.idle.timeout to a value lower than load-balancer timeout.
    However on enabling this property, we see the following error messages in the debug log file amEventService:
    WARNING: EventService.processResponse() - Received a NULL Response. Attempting to re-start persistent searches
    EventService.processResponse() - received DS message => [LDAPMessage] 85687 SearchResult {resultCode=51, errorMessage=too many simultaneous persistent searches}
    netscape.ldap.LDAPException: Error result (51); too many simultaneous persistent searches; LDAP server is busy
    Any idea - why this occurs?
    Do we need to modify the value associated with the attribute nsslapd-maxpsearch ?
    How many Persistent searches does Access Manager fire on the Directory Server ? Can this be controlled ?
    TIA,
    Chetan

    I am having an issue where the Access Manager does not seem to fire any persistent searches at all to the DS.
    We have disabled properties which try to disable certain types of persistent searches and hence in reality there should be lots of persistent searches being fired to the DS.
    Also, there does seem to be some communication between the DS and the Access Manager instance. ....as the AM instance we work on talks only to a particular DS instance. But they do not seem to find any persistent searches being fired from our side at all....the only time they did see some persistent searches was when I did a persistent search from the command line.
    What could be the issue??
    thanks
    anand

  • Outlook 2011 (Mac) Default Search Folder

    This question is for Outlook 2011 (Mac)  Does anyone know how to change the default search folder from All Folders in the Contacts Search? I want to make the default folder my company's ldap directory. It works fine when you select it from the list,
    but it would be a lot more convenient if it searched ldap by default. I've searched online and haven't seen an answer to this.
    Thanks.

    Hi Andre,
    Thanks for visiting, this is the forum to discuss questions and feedback for Microsoft Outlook for Windows.
    For Outlook for Mac user, it will be better to visit:
    http://answers.microsoft.com/en-us/mac/forum/macoutlook
    Sincerely,
    Max Meng
    Forum Support
    Come back and mark the replies as
    answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please contact
    [email protected]

Maybe you are looking for

  • Can not update exchange due to error with Active directory

    Error: The following error was generated when "$error.Clear();  Install-CannedRbacRoles -InvocationMode $RoleInstallationMode -DomainController $RoleDomainController " was run: "Active Directory operation failed . This error is not retriable. Additio

  • How can i get my music back if my computer crashed?

    My PC's hardrive crashed and I wasn't able to save anything music wise off of it. So all I really care about are my music videos and movies that I've purchased. How do I get them back?

  • Report Painter - Excel Download - Urgent

    Dear All, I have created a Report in Report Painter. How do I add an option for the user to export the file in xls. once it is executed? Where do I do this configuration? Please do revert back at the earliest. Regards Dattatray

  • HTML SharePoint Document Library setup

    Hi, Following the steps from https://msdn.microsoft.com/en-us/library/office/dn592160.aspx to associate a document library with an entity I've managed to implement everything but stuck on the step in which I add the button and then need to select the

  • AD RMS 2012 On Premise queries

    I have followed couple of articles on AD RMS (On premise) on Technet but still unable to get clear idea on below concerns....Please help me in clearing the doubts. 1) AD RMS 2012 :- Which edition of Sharepoint Server 2013 is spported. Can it support