Previous Topic: Counting Entries

Next Topic: Example: Count Entries in a Distributed Directory

Example: Count Entries in a Single DSA

This example shows how to search a single DSA for entries in which the sn attribute starts with C.

This is a subtree search, which means that the filter is applied to the base object and all entries in the tree below the base object.

To count how many entries in the Democorp DSA have a surname starting with the letter C

  1. Run the following search:
    dxsearch -h computer-name -p 19389 -s subtree -b "o=DEMOCORP,c=AU" (sn="C*") dxEntryCount
    

    In this search, computer-name is the computer that contains the Democorp DSA.

    This search returns a single entry with a dxEntryCount attribute, which is set to the number of entries that satisfy the search filter.

  2. Check the following result for the number of entries:
    o=DEMOCORP,c=AU
    dxEntryCount=98
    

    This search result indicates that there are 98 entries with a surname beginning with C in the Democorp DSA.