SIMPLE : Making a list from a directory

Hello, I can't find this on my computer. I have a script that shows all files of the front directory. I need this script but also need the list in text editor
It(the script) should also watch inside the folder for all files in all subfolders. So I get a list in text editor that i can print. Someone who can help me with this?
Now i get a menu but I just need to print the list of all files.
Thanks in advance.
tell application "Finder"
set allFiles to the name of every file in the front window
end tell
choose from list allFiles

Hello
You may try something like the code below.
It will let you choose the source folder and write list to a file named 'files.txt' in your current destkop.
--SCRIPT
set srcdir to POSIX path of (choose folder)
set outfile to POSIX path of (path to desktop from user domain) & "files.txt"
set sh to "ls -R " & quoted form of srcdir & " > " & quoted form of outfile
do shell script sh
--END OF SCRIPT
cf.
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/ls.1.htm l
Hope this may help,
H
Message was edited by: Hiroto (fixed code)

Similar Messages

  • Cfldap to get 2 level of subordinates list from active directory

    <CFLDAP SERVER="ldap.com" PORT="333" START="O=COM,C=AN" SCOPE="SUBTREE"
    NAME="qryLevel1" ACTION="QUERY" ATTRIBUTES="cn, uid, alias"
    FILTER="(&(manager=cn=TestName,ou=employee,o=COM,c=an)(objectclass=olPerson))" MAXROWS="999999" TIMEOUT="90000">
    By using the above code, I am able to get subordinates for User(TestName), But I need the list of subordinate of all the subordinates also without loop please as it is taking long time to execute.
    please assist me on this??

    Create a "global catalog" on the 2nd domain contoller, will fix this problem. 
    To create a new global catalog:
    On the domain controller where you want the new global catalog, start the Active Directory Sites and Services snap-in. To start the snap-in, click Start , point to Programs , point to Administrative Tools , and then click Active Directory Sites and Services .
    In the console tree, double-click Sites , and then double-click <var>sitename</var> .
    Double-click Servers , click your domain controller, right-click NTDS Settings , and then click Properties .
    On the General tab, click to select the Global catalog check box to assign the role of global catalog to this server.
    Restart the domain controller.

  • Retrieve file/directory listing from a URL

    I am building an applet to view images located on a given URL (not the same as the codebase URL...). The problem is how to see which directories and files that are located on the given URL? File.list() works fine as long as I'm the pictures are located on my own computer, but I would like to do something like:
    File f = new File(new URL("http://.../imagelibrary"));
    String [] x = f.list();
    Please help me out!
    You'll get credited for it - I promise!
    /Markus

    Hi,
    I make a try to help you. A applet has only a HttpConnection to the server. Typical over this connection you can receive a file. E.g., when you connect the http-server by a browser, you becomes a html-page, with a table or list from the directory,when it allowed. Over a HttpURLConnection you can receive this html-code by the following code-snippet:public class DownLoad {
         public static void main(String args[]) {
              try {
                   java.net.URL url = new java.net.URL("http://localhost:8080/../images/");
                   java.io.InputStream in = url.openStream();
                   int count = in.available();
                   byte content[] = new byte[count];
                   in.read(content, 0, count);
                   String contentAsString = new String(content, 0, count);
                   System.out.println(contentAsString);
              } catch (Exception e) {
                   e.printStackTrace();
    }Now you can show this in the applet directly or you parse the contentAsString and find the entry in the table/list.
    Hope thats help
    Roland

  • Getting list of all users and their group memberships from Active Directory

    Hi,
    I want to retrieve a list of all the users and their group memberships through JNDI from Active Directory. I am using the following code to achieve this:
    ==================
    import javax.naming.*;
    import java.util.Hashtable;
    import javax.naming.directory.*;
    public class GetUsersGroups{
         public static void main(String[] args){
              String[] attributeNames = {"memberOf"};
              //create an initial directory context
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, "ldap://172.19.1.32:389/");
              env.put(Context.SECURITY_AUTHENTICATION, "simple");
              env.put(Context.SECURITY_PRINCIPAL, "[email protected]");
              env.put(Context.SECURITY_CREDENTIALS, "p8admin");
              try {
                   // Create the initial directory context
                   DirContext ctx = new InitialDirContext(env);     
                   //get all the users list and their group memberships
                   NamingEnumeration contentsEnum = ctx.list("CN=Users,DC=filenetp8,DC=com");
                   while (contentsEnum.hasMore()){
                        NameClassPair ncp = (NameClassPair) contentsEnum.next();
                        String userName = ncp.getName();
                        System.out.println("User: "+userName);
                        try{
                             System.out.println("am here....1");
                             Attributes attrs = ctx.getAttributes(userName, attributeNames); // only asked for one attribute so only one should be returned
                             System.out.println("am here....2");
                             Attribute groupsAttribute = attrs.get(attributeNames[0]); // memberOf
                             System.out.println("-----"+groupsAttribute.size());
                             if (groupsAttribute != null){
                                  // memberOf is a multi valued attribute
                                  for (int i=0; i<groupsAttribute.size(); i++){
                                  // print out each group that user belongs to
                                  System.out.println("MemberOf: "+groupsAttribute.get(i));
                        }catch(NamingException ne){
                        // ignore for now
                   System.err.println("Problem encountered....0000:" + ne);
                   //get all the groups list
              } catch (NamingException e) {
              System.err.println("Problem encountered 1111:" + e);
    =================
    The following exception gets thrown at every user entry:
    User: CN=Administrator
    am here....1
    Problem encountered....0000:javax.naming.NamingException: [LDAP: error code 1 -
    000020D6: SvcErr: DSID-03100690, problem 5012 (DIR_ERROR), data 0
    ]; remaining name 'CN=Administrator'
    I think it gets thrown at this line in the code:
    Attributes attrs = ctx.getAttributes(userName, attributeNames);
    Any idea how to overcome this and where am I wrong?
    Thanks in advance,
    Regards.

    In this sentence:
    Attributes attrs = ctx.getAttributes(userName, attributeNames); // only asked for one attribute so only one should
    It seems Ok when I add "CN=Users,DC=filenetp8,DC=com" after userName, just as
    userName + ",CN=Users,DC=filenetp8,DC=com"
    But I still have some problem with it.
    Hope it will be useful for you.

  • How to populate a sharepoint 2010 list from the active directory. How to populate a sharepoint 2010 list with all sharepoint user profiles

    How to populate a sharepoint 2010 from the active directory.
    I want a list of all the computers in the active directory,
    another one with all users.
    I want also to populate a sharepoint 2010 list from the sharepoint user profiles.
    Thanks
    sz

    While
    the contacts list is usually filled out for contacts that are outside the company, there are times when you would use a contacts list to store internal and external resources.  Wouldn’t it be nice if you didn’t have to re-type your internal contacts’
    information that are already in the system?  Now you can with a little InfoPath customization on the contacts list. 
    Here’s our plan:
    Create the contacts list, and open in InfoPath
    Create a data connection to the User Profile web service
    Customize the form adding some text, a people picker and a button
    Create InfoPath rules that will populate the contact fields from the user fields in the User Profile store
    Let’s get going!  Before we begin, make sure you have InfoPath 2010 installed locally on your computer.  I also want to give credit Laura
    Rogers and Darvish Shadravan’s book Using
    Microsoft InfoPath 2010 with Microsoft SharePoint 2010 Step by Step.  I know it looks like a lot of steps, but it’s easy once you get the hang of it.
    So obviously we need a contacts list.  If you don’t already have one, go to the SharePoint site where it will live, and create a contacts list.
    From the list, click the List tab on the ribbon, then click Customize form:
    So now we have our form open in InfoPath 2010.  Let’s add our elements to the form. 
    Above all the fields, let’s add some text instructing users what to do with the the field we’re about to add (.e.g To enter an existing user’s information, choose the user below).
    Insert a people picker control by clicking the Person/Group Picker control in the Controls section of the ribbon.  This will add a column to the contacts list called group.
    Below the people picker, insert a button control from the same section of the ribbon as above.  With the button still highlighted, click the Control Tools|Properties tab on the ribbon. 
    Then in the Label box, change the text to something more appropriate to our task (e.g. Click here to load user data!).
    You can drag the button control a little larger to account for the text.
    We should end up with something like this:
    Before we can populate the fields with user data, we need to create a connection to the User Profile Service.
    Add a data connection to the User Profile Service
    Click the Data tab on the ribbon, and click the option From Web Service, and From SOAP Web Service.
    For the location, enter the URL of your SharePoint site in the following format – http://<site url>/_vti_bin/UserProfileService.asmx?WSDL.  Click Next.
    Note - for the URL, it can be any SharePoint site URL, not just to the site where your list is.
    For the operation, choose GetUserProfileByName.  Click Next.
    Click Next on the next two screens.
    On the final screen, uncheck the box for “Automatically retrieve data when form is opened”. This is because we are going to retrieve the data when the button is clicked, also for performance reasons.
    Now we need to wire up the actions on our button to populate the fields with the information for the user in the people picker control.
    Tell the form to read the user from the people picker control
    Click the Home tab on the ribbon.
    Click the button control we created, and under the Rules section of the ribbon, click Manage Rules. Notice the pane appear on the far right.
    In the Rules pane, click New –> Action. Change the name to something like “Query and load user data”.
    Leave the condition to default (none – rule runs when button is clicked).
    Click the Add button next to “Run these actions:”, and choose “Set a field’s value”.
    For Field, click the button on the right to load the select a field dialog.  Click the Show advanced view on the bottom.  At the top, click the drop down and choose the GetUserProfileByName
    (Secondary) option.  Expand myFields and queryFields to the last option and highlightAccountName.  Click ok. 
    For Value, click the formula icon. On the formula screen, click the Insert Field or Group button. Again click the show advanced view link, but this time leave the data
    connection as Main. Expand dataFields, then mySharePointListItem_RW.  At the bottom you should see a folder called group (the people picker control we just added to the form).  Expand this, then pc:Person,
    and highlightAccountId.  Click Ok twice to get back to the Rules pane.
    If we didn’t do this and just queried the user profile service, it would load the data of the currently logged in user.  So we need to tell the form what user to load the data for.  We take the AccountID field from the people
    picker control and inject into the AccountName query field of the User Profile Service data connection. 
    Load the user profile service information for the chosen user
    Click the Add button next to “Run these actions:”, and choose Query for data.
    In the popup, for Data connection, click the one we created earlier – GetUserProfileByName and clickOk.
    We’re closing in on our goal.  Let’s see our progress.  We should see something like this:
    Now that we have the user’s data read into the form, we can populate the fields in the contact form.  The number of steps to complete will depend on how many fields you want to populate.  We need to add an action step for
    each field.  I’ll show you one example and then you will just repeat the steps for the other fields.  Let’s update the Job Title field.
    Populate the contact form fields with existing user’s data
    Click the Add button next to “Run these actions:”, and choose “Set a field’s value”.
    For Field, click the button on the right to load the select a field dialog.  Highlight the field Job Title.
    For Value, click the formula icon. On the formula screen, click the Insert Field or Group button.  Click the Show advanced view on the bottom. At the top, click the
    drop down and choose theGetUserProfileByName (Secondary) option.  Expand the fields all the way down until you see the Value field.  Highlight it but don’t click ok, but click the Filter
    Data button, then Add. 
    For the first dropdown that says Value, choose Select a field or group.   The value field will be highlighted, but click the field Name field
    under PropertyData.  Click Ok. 
    In the blank field after “is equal to”, click in the box and choose Type text.  Then type the text Title. 
    Click ok until you get back to the Manage Rules pane.  The last previous screen will look like this.
    We’re going to update common fields that are in the user’s profile, and likely from Active Directory.  You can update fields like first and last name, company, mobile and work phone number, etc.  For the other fields, the
    steps are the same except the Field you choose to update from the form, and the very last step where you enter the text will change.  Here’s what the rules look like when we’re done:
    We’re all done, good work!  You can preview the form and try it now.  Click Ctrl+Shift+B to preview the form.  Once you’re satisfied, you can publish the form back to the library.  Click File –> Quick
    Publish.  Once it’s done, you will get confirmation:
    Now open your form in SharePoint.  From the contact list, click Add new item.  Type in a name, and click the button and watch the magic happen!

  • Get file list from directory(t.code: AL11).

    Hi Frnds,
    i need to get the list of file for particular directory from t.code AL11,
    is there any Function Module to display the list of File from  the directory in executable program,
    i have directory like '/home/im3/hrintf/processed/..... ' and now i need to get the list of file from that directory,
    the list is available in t.code AL11( standard program :RSWATCH0 ).
    pls suggest me with relevant FM or relevant logic.
    Thank you.
    Regards
    Ramesh M

    Hi 
       use this code i have checked its working fine
    Data:
          w_itab type table of  EPSFILI,
          w_dirnam type  EPSF-EPSDIRNAM.
          w_dirnam = 'C:\usr\sap\E6S\DVEBMGS00\work'.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
      EXPORTING
        dir_name                     = w_dirnam
    *   FILE_MASK                    = ' '
    * IMPORTING
    *   DIR_NAME                     =
    *   FILE_COUNTER                 =
    *   ERROR_COUNTER                =
      tables
        dir_list                     = w_itab
    * EXCEPTIONS
    *   INVALID_EPS_SUBDIR           = 1
    *   SAPGPARAM_FAILED             = 2
    *   BUILD_DIRECTORY_FAILED       = 3
    *   NO_AUTHORIZATION             = 4
    *   READ_DIRECTORY_FAILED        = 5
    *   TOO_MANY_READ_ERRORS         = 6
    *   EMPTY_DIRECTORY_LIST         = 7
    *   OTHERS                       = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write: 'test'.
    Thanks
    Viquar Iqbal

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Cannot "enable directory listing" from the wadm CLI

    With SJSWS 6.1 sp1 up to sp11, there was a documented bug that caused directory listing to work even though the ACL was:
    acl "default";
    authenticate (user, group) {
      prompt = "Sun ONE Web Server";
    allow (read, execute, info) user = "anyone";
    allow (list, write, delete) user = "all";With SJSWS 7.0, this bug was fixed. The default installed ACL is exactly the same from 6.1 to 7.0. e.g. the "list" right is given only to [all] authenticated user, and not everyone. So requesting a "GET /images/" will give you a 401 unauthorized, as should have happened in 6.1, which causes your browser to prompt you to login.
    By default, 7.0 webserver configs are created with directory listing enabled with "index-common". But it can also be disabled, directing the user to a defined static file on the web server disk. i.e.:
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="send-error" path="/path/on/disk/notFound.html"In either case, out of the box, neither enabling nor disabling directory listing matters because the default ACL denies directory listing in the prior case, and denies the "notFound.html" response in the later. Note "allow (list) user = all" requires authentication for the "list"privilege.
    To fix this, you change the ACL so the "list" privilege is in the first ACI, i.e., 'allow (read, execute, info, list) user = "anyone";'
    The problem is that even though the ACL file can be modified in the Admin Web GUI, it cannot be modified from the the wadm CLI.
    So, because of this, technically one cannot truly enable directory listing (wadm enable-directory-listing) using wadm. The best you can do is manually edit the existing ACL, or create a new ACL file and set that new file using wadm.
    I don't even see a way, using wadm, to dump new content into the ACL file. Without the GUI, you are stuck. And you cannot perform remote administration for this feature using wadm.
    If we admins are creating TCL scripts to automate creating and configuring webserver configs, this feature cannot be configured.
    I would like to know if I am wrong, and how I could resolve this using the wadm CLI alone.
    And if the default is going to remain that the "list" privilege requires authentication, this should be documented in the SJSWS7 documentation for enabling and disabling directory listing.

    pull-config does not work in this case because of two reasons:
    1. you must still manually edit the ACL file (can already do that on the admin server)
    2. and you must make that change on a node which has the configuration
    In my case, I want to remotely manage the configuration using wadm. But I do not want to log into one of the nodes in the server farm.
    And I want to avoid having to edit the ACL file manually if possible, or through the GUI which requires manual intelligent point-and-click efforts.
    Seems like my only bet is to:
    1. create the config via the wadm tcl shell
    2. then outside of the wadm command, execute some script that can perform a scp to the admin server, or a ssh for a local copy of a previously written ACL file - which requires a lot of extra setup to make that happen.
    3. then get back into wadm to execute the other tasks
    I want to avoid step #2.

  • Directory listing from my OS X 10.5.8 server into a text file

    Does anyone know how I can get a directory listing from my server, which I can put into an Excel Spreadsheet?
    Thanks

    Download the free TextWrangler and drag the enclosing folder into it. Alternatively, open the AppleScript Editor in the /Applications/Utilities/ folder, paste the following in:
    do shell script "ls -AR " & quoted form of POSIX path of ((choose folder) as alias) & " >> ~/Desktop/inventory.txt"
    and run it as is.
    (104088)

  • Directory List from XML

    I would outsource this section of a Flash site to someone who
    understands
    actionscript and xml.
    The section that needs to be created is a project title
    directory.
    The project title list or directory:
    1. needs to be created from an existing XML file.
    2. be displayed in Flash as 3 columns with a scroll when
    necessary. Each
    column lists all Proj_title's for that Category.
    3. Clicking on a Proj_title from the list would open up that
    project in the
    existing allprojects.fla.
    The All Projects page is already done and pulls its data from
    the same XML
    file.
    It displays scrolling images of products. When an image is
    clicked, a
    detailed section opens with other images and text all coming
    from the same
    xml file. This section is completed. Now with a Directory
    List, the same
    happens when clicking on a Proj_title from the list.
    The directory list is what needs to be done.
    The XML file contains: Image, Category, Proj_title,
    Thumbnail, Summary,
    Description, Picture1, Pic1Desc, Picture2, Pic2Desc,
    Picture3, Pic3Desc,
    Use, Builder, Builder etc.....
    The XML file used for the directory is the same used for the
    rest of this
    allprojects.fla..
    Please find link to see the xml file:
    www.filecondo.com/allimages.xml
    If you are interested in this freelance job please respond to
    this post.
    Thank you

    The IsGetDevice operation will get you all the devices including their extension numbers from a CME. You need to set up the router XML interface on the router as per this document: http://cisco.com/en/US/docs/voice_ip_comm/cucme/srnd/design/guide/managcme.html#wp1076023
    then follow the appropriate developer guide which you can get here: http://www.cisco.com/cgi-bin/dev_support/access_level/product_support (under voice gateway applications)
    You'll also find searching this forum for the topic useful as there are a few things the developer guide fails to mention (specifially that you need to urlencode the message before sending).

  • PowerShell Print Server remove checkmark from print share "List in the Directory"

    I needed to remove the checkmark in the "List in the directory" box under printer queue sharing for several hundred print queues on multiple Windows 2003 print servers.  I ended up doing it manually because I could not figure out how to do it with
    PowerShell.  Would like to be prepared for next time and learn a bit more about PowerShell.  Scripting newbie.  Anyone able to get me started?  Couldn't find the registry key pertaining to the setting though I could find it under get-wmiobject
    - class win32_printer ... -property published.  Have googled for 2 days.  Most of the scripts suggestions that seem to apply are a bit more extensive and complicated than I am willing to tackle with my experience level.

    Great code. I wanted the opposite (to enable it) so I wrote this - which checks to see if the printer has a . in the portname (which for me shows it has an IP address) and to see that it's not already shared.
    $printers = Get-WMIObject -class Win32_Printer -computer localhost
    foreach ($printer in $printers) {
    IF ($Printer.PortName.Contains(".") -and $printer.published -eq $false) {
    $printer.Name + " : " + $printer.published
    $printer.published = $true
    $printer.put()

  • Making a html list from itunes playlist

    I'm trying to sell all of my cd's and instead of typing out my list of cds...I was trying to make a list from my itunes library.
    I've searched for this topic already but I can't seem to find it-sorry if I missed it and I'm reasking.
    If you have any ideas-please email me I WILL NOT CHECK THIS THREAD...it was hard getting here. <Edited by Moderator>
    Thank you!

    I WILL NOT CHECK THIS THREAD
    Then YOU WILL NOT GET AN ANSWER.
    it was hard getting here.
    3 mouse clicks and entering a username/password are hard
    I'm trying to sell all of my cd's
    Gonna also delete all the music off those CDs from iTunes?

  • How do I get info from Active Directory and use it in my web-applications?

    I borrowed a nice piece of code for JNDI hits against Active Directory from this website: http://www.sbfsbo.com/mike/JndiTutorial/
    I have altered it and am trying to use it to retrieve info from our Active Directory Server.
    I altered it to point to my domain, and I want to retrieve a person's full name(CN), e-mail address and their work location.
    I've looked at lots of examples, I've tried lots of things, but I'm really missing something. I'm new to Java, new to JNDI, new to LDAP, new to AD and new to Tomcat. Any help would be so appreciated.
    Thanks,
    To show you the code, and the error message, I've changed the actual names I used for connection.
    What am I not coding right? I get an error message like this:
    javax.naming.NameNotFoundException[LDAP error code 32 - 0000208D: nameErr DSID:03101c9 problem 2001 (no Object), data 0,best match of DC=mycomp, DC=isd, remaining name dc=mycomp, dc=isd
    [code]
    import java.util.Hashtable;
    import java.util.Enumeration;
    import javax.naming.*;
    import javax.naming.directory.*;
    public class JNDISearch2 {
    // initial context implementation
    public static String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory";
    public static String MY_HOST = "ldap://99.999.9.9:389/dc=mycomp,dc=isd";
    public static String MGR_DN = "CN=connectionID,OU=CO,dc=mycomp,dc=isd";
    public static String MGR_PW = "connectionPassword";
    public static String MY_SEARCHBASE = "dc=mycomp,dc=isd";
    public static String MY_FILTER =
    "(&(objectClass=user)(sAMAccountName=usersignonname))";
    // Specify which attributes we are looking for
    public static String MY_ATTRS[] =
    { "cn", "telephoneNumber", "postalAddress", "mail" };
    public static void main(String args[]) {
    try { //----------------------------------------------------------        
    // Binding
    // Hashtable for environmental information
    Hashtable env = new Hashtable();
    // Specify which class to use for our JNDI Provider
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    // Specify the host and port to use for directory service
    env.put(Context.PROVIDER_URL, MY_HOST);
    // Security Information
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, MGR_DN);
    env.put(Context.SECURITY_CREDENTIALS, MGR_PW);
    // Get a reference toa directory context
    DirContext ctx = new InitialDirContext(env);
    // Begin search
    // Specify the scope of the search
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    // Perform the actual search
    // We give it a searchbase, a filter and the constraints
    // containing the scope of the search
    NamingEnumeration results = ctx.search(MY_SEARCHBASE, MY_FILTER, constraints);
    // Now step through the search results
    while (results != null && results.hasMore()) {
    SearchResult sr = (SearchResult) results.next();
    String dn = sr.getName() + ", " + MY_SEARCHBASE;
    System.out.println("Distinguished Name is " + dn);
    // Code for displaying attribute list
    Attributes ar = ctx.getAttributes(dn, MY_ATTRS);
    if (ar == null)
    // Has no attributes
    System.out.println("Entry " + dn);
    System.out.println(" has none of the specified attributes\n");
    else // Has some attributes
    // Determine the attributes in this record.
    for (int i = 0; i < MY_ATTRS.length; i++) {
    Attribute attr = ar.get(MY_ATTRS);
    if (attr != null) {
    System.out.println(MY_ATTRS[i] + ":");
    // Gather all values for the specified attribute.
    for (Enumeration vals = attr.getAll(); vals.hasMoreElements();) {
    System.out.println("\t" + vals.nextElement());
    // System.out.println ("\n");
    // End search
    } // end try
    catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
    My JNDIRealm in Tomcat which actually does the initial authentication looks like this:(again, for security purposes, I've changed the access names and passwords, etc.)
    <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
    connectionURL="ldap://99.999.9.9:389"
    connectionName="CN=connectionId,OU=CO,dc=mycomp,dc=isd"
    connectionPassword="connectionPassword"
    referrals="follow"
    userBase="dc=mycomp,dc=isd"
    userSearch="(&(sAMAccountName={0})(objectClass=user))"
    userSubtree="true"
    roleBase="dc=mycomp, dc=isd"
    roleSearch="(uniqueMember={0})"
    rolename="cn"
    />
    I'd be so grateful for any help.
    Any suggestions about using the data from Active directory in web-application.
    Thanks.
    R.Vaughn

    By this time you probably have already solved this, but I think the problem is that the Search Base is relative to the attachment point specified with the PROVIDER_URL. Since you already specified "DC=mycomp,DC=isd" in that location, you merely want to set the search base to "". The error message is trying to tell you that it could only find half of the "DC=mycomp, DC=isd, DC=mycomp, DC=isd" that you specified for the search base.
    Hope that helps someone.
    Ken Gartner
    Quadrasis, Inc (We Unify Security, www -dot- quadrasis -dot- com)

  • How can I email a group list from my contacts/Mac address book?

    I love the Apple address book for making media lists for my PR business because it enables me to add dates and actions.  But when a client wants to see the list via email, I'm flummoxed. I've been rewriting as a Word document, but that eliminates the convenience of Address Book.   I could print, scan, and send,but that's cumbersome. If we can share a contact, why can't we share a Group list? Or, am I missing something simple?
    Thanks!

    Howdy J-carolyn9,
    Welcome to Apple Support Communities.
    Take a look at the article linked below, it’ll walk you through the process of printing a group of contacts from Address Book on your Mac.
    Mac Basics: Address Book - Apple Support
    If you'd like a tangible address book, print out a pocket-sized version of Address Book. Select the names that you want to include from the contacts list, or select a group, and choose Print from the File menu. Click Show Details, and choose Pocket Address Book from the Style pop-up menu, select any other options you want, and click Print.
    Ciao,
    -Jason

  • Help!  Example to list users Active Directory

    Hello, I�m totaly new to jndi. I need to obtain the list of users from Active Directory. Can anyone point me to an example or tutorial?
    Thanx
    Javier

    After alot of trial and error I think I got this example to work. I got the example somewhere in this forum but I don�t remember from who, so if you think it�s your code, thanks. I hope it is usefull for anyone else....
    <code>
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.naming.directory.*;
    import javax.naming.ldap.*;
    import javax.naming.*;
    import java.util.Hashtable;
    import java.util.Enumeration;
    public class JndiTest
         public static void main(String[] args)
              System.out.println("Starting...");
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, "ldap://10.20.223.129:389/");
              env.put(Context.SECURITY_AUTHENTICATION, "simple");
              env.put(Context.SECURITY_PRINCIPAL, "[email protected]");
              env.put(Context.SECURITY_CREDENTIALS, "digitel412");
              try
                   DirContext ctx = new InitialDirContext(env);
                   SearchControls ctls = new SearchControls();
                   ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   String[] attrs = { "cn", "telephoneNumber", "sn", "userPrincipalName","memberOf","name" };
                   ctls.setReturningAttributes(attrs);
                   String filter = "(objectClass=organizationalPerson)";
                   NamingEnumeration answer = ctx.search("CN=Users,DC=digiteltest,DC=com,DC=xx", filter, ctls);
                   while (answer.hasMoreElements())
                        //NameClassPair nc = (NameClassPair)answer.next();
                        //System.out.println(nc);
                        SearchResult si = (SearchResult) answer.next();
                        Attributes attribs = si.getAttributes();
                        if (attribs == null)
                             System.out.println("No attributes");
                        else
                             for (NamingEnumeration ae = attribs.getAll(); ae.hasMoreElements();)
                                  Attribute attr = (Attribute) ae.next();
                                  String attrId = attr.getID();
                                  for (Enumeration vals = attr.getAll(); vals.hasMoreElements(); System.out.println(attrId + ": " + vals.nextElement()));
                        System.out.println("======================================================================================");
                   ctx.close();
              catch (Exception e)
                   e.printStackTrace();
              System.out.println("Finished.");
    </code>

Maybe you are looking for

  • Follow up doc in R/3 using action profile

    Hi   1)How to create a follow up doc i.e billing doc in r/3 for sales order created in crm?    2) How to create a New Tab Using EEWB for Marketing campaign? its showing only basic data,channels... Regards, sanjana

  • IPad 2 earphones not working after updating to ios 6 (jack input is clean)

    Hi there, I can see some people have been having problems with their new iPad and earphones in conjunction with ios 6 but did not know if there was a thread established for the iPad 2 yet. I updated tonight and along with the fact that ios 6 is a com

  • Itunessetup.exe is not a valid win32 application?!? help!

    has anyone else been getting an error message when trying to upgrade to itunes 7 that says something to the effect of "itunessetup.exe is not a valid win32 application" ??? does anyone know what this means or how i can fix it??

  • MacBookPro running 10.8.5 fails to wake from sleep or kp???

    Folks: I installed ML 10.8.5 a couple weeks ago in a separate partition from SL 10.6.8, and more or less things have been OK.  Today, however I'm wondering if 10.8.5 has a "Rip van Winkle" type "glitch" that causes problems with the unit waking from

  • Can't find smbutil Solaris 10

    Hi There. I'm a solaris beginner and must mount an CIFS Share I would like to mount an Netgear NAS with my Solaris 10 OS. I found the doc "How to Find Available CIFS Shares on a Known File Server" [SUN Document|http://docs.sun.com/app/docs/doc/820-24