Previous Topic: Example: Count Entries at a Single Level in a Single DSA

Next Topic: Pattern Matching

Example: Count the Entries at the Base Level

If you run a search designed to count the entries that satisfy a filter at the base level, the search result is either 1 or 0. This can be useful if you run the search programmatically.

The following example shows how to check whether the organization attribute of the Democorp base entry includes the letter "c".

To check whether the base object matches a search filter

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

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

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

    This search result indicates that the organization attribute for the Democorp base object does include the letter c.