6.8 Querying LDAP Objects

To query an object, use the --query option, an object option such as --scLocation or --scBranchServer, and, if desired, an attribute-value pair.

Table 6-17 summarizes the posAdmin command options for querying the LDAP database.

Table 6-17 Command options for querying the LDAP database

Option

Type

Description

--base

must

The base option sets the base in which to search for objects. On the Administration Server, the default base is the organization (o=mycorp,c=us).

--object

must

Object to be queried; for example, --scLocation.

--attribute

may

Attribute to search within the specified object; for example, --ipNetworkNumber

--value

may

If an attribute value is given, only objects with matching values are searched.

The following examples illustrate possible posAdmin queries.

Example 1

List all locations with all data in boston:

posAdmin.pl --user cn=admin,o=mycorp,c=us --password secret
--base ou=boston,o=mycorp,c=us --query --scLocation 

Example 2

List all locations in boston that show only the ipNetworkNumber:

posAdmin.pl --user cn=admin,o=mycorp,c=us --password secret 
--base ou=boston,o=mycorp,c=us 
--query --scLocation --ipNetworkNumber

Example 3

List all locations in boston that show only the ipNetworkNumber 192.168.1.0:

posAdmin.pl --user cn=admin,o=mycorp,c=us --password secret 
--base ou=boston,o=mycorp,c=us --query --scLocation 
--ipNetworkNumber 192.168.1.0