Chapter 4. Searching Identity Management entries from the command line
Locate and view Identity Management (IdM) entries by using search filters and display commands.
4.1. Overview of listing IdM entries Copy linkLink copied to clipboard!
Identify specific entries within the Identity Management (IdM) database by using search filters and keywords. You can use the ipa *-find commands to retrieve lists of objects and to filter results based on user membership or attribute matches.
Useful search commands
To list all the
findcommands, use thegreputility with theipa helpcommand:$ ipa help commands | grep findTo list all users in the IdM database, use the following command:
$ ipa user-findTo list user groups whose specified attributes contain a keyword, run:
$ ipa group-find <keyword>For example the
ipa group-find admincommand lists all groups whose names or descriptions include the stringadmin:---------------- 3 groups matched ---------------- Group name: admins Description: Account administrators group GID: 427200002 Group name: editors Description: Limited admins who can edit other users GID: 427200002 Group name: trust admins Description: Trusts administrators groupTo search for groups that contain a particular user:
$ ipa group-find --user=<user_name>To search for groups that do not contain a particular user:
$ ipa group-find --no-user=<user_name>
4.2. Showing details for a particular entry Copy linkLink copied to clipboard!
Retrieve the full technical configuration and attribute list for a specific Identity Management (IdM) entry. You can use the ipa <object>-show command to display detailed information for a single object, such as a host, user, or service, rather than a filtered list of multiple results.
Procedure
To display details for a specific entry, run the
ipa <object>-showcommand followed by the name of the entry. For example:$ ipa host-show server.example.comThe CLI displays the full record for the specified object:
Host name: server.example.com Principal name: host/server.example.com@EXAMPLE.COM ...
4.3. Modifying LDAP attribute values for an IPA command option Copy linkLink copied to clipboard!
You can add or remove values of LDAP attributes for Identity Management (IdM) command options by using the --addattr and --delattr options. Unlike passing the full option value directly, these options modify only the specified value without overwriting the remaining existing values.
Procedure
Use the
ipa show-mappingscommand with the IPA command name to display the LDAP attribute mappings:$ ipa show-mappings <command>For example, to list the LDAP attribute mappings for the
config-modcommand:$ ipa show-mappings config-mod ----------------------------- Number of entries returned 77 ----------------------------- ca_renewal_master_server: caRenewalMaster enable_migration: ipaMigrationEnabled ... userobjectclasses: ipauserobjectclasses * ...Optional: If the output contains too many entries, pipe the command through
grepto filter for the option you need:$ ipa show-mappings <command> | grep <option>For example:
$ ipa show-mappings config-mod | grep userobjectclasses userobjectclasses: ipauserobjectclasses *Note the symbol after the LDAP attribute name, which indicates whether the attribute is required and how many values it can hold:
Expand Symbol Meaning (none)
Mandatory, single-valued
+Mandatory, multi-valued
?Optional, single-valued
*Optional, multi-valued
For example,
ipauserobjectclasses *means the attribute is optional and multi-valued.Use the LDAP attribute name to add or remove a value:
To add a new value, use
--addattr <attribute>=<value>. For example, to add themailRecipientobject class to the list of user object classes:$ ipa config-mod --addattr ipauserobjectclasses=mailRecipientTo remove an existing value, use
--delattr <attribute>=<value>. For example, to remove themailRecipientobject class from the list of user object classes:$ ipa config-mod --delattr ipauserobjectclasses=mailRecipientNoteIn this example,
mailRecipientis an object class name. The LDAP attributeipauserobjectclassesstores a list of object class names, so each value you add or remove with--addattror--delattris an object class name, not an LDAP attribute.
Verification
To verify the change, run the corresponding show command and check that the value is present or absent. For example, after running
ipa config-mod, run:$ ipa config-show | grep objectclasses User object classes: top, person, organizationalperson, inetorgperson, inetuser, posixaccount, krbprincipalaux, krbticketpolicyaux, ipaobject, ipasshuser, mepOriginEntry, mailRecipient
4.4. Adjusting the search size and time limit Copy linkLink copied to clipboard!
Some queries, such as requesting a list of IdM users, can return a very large number of entries. By tuning these search operations, you can improve the overall server performance when running the ipa *-find commands, such as ipa user-find, and when displaying corresponding lists in the Web UI.
- Search size limit
Defines the maximum number of entries returned for a request sent to the server from a client’s CLI or from a browser accessing the IdM Web UI.
Default: 100 entries.
- Search time limit
Defines the maximum time (in seconds) that the server waits for searches to run. Once the search reaches this limit, the server stops the search and returns the entries discovered in that time.
Default: 2 seconds.
If you set the values to -1, IdM does not apply any limits when searching.
Setting search size or time limits too high can negatively affect server performance.
4.4.1. Adjusting the search size and time limit in the command line Copy linkLink copied to clipboard!
You can adjust the search size and time limits globally or for a specific entry to optimize search performance and responsiveness.
Procedure
To display current search time and size limits in CLI, use the
ipa config-showcommand:$ ipa config-show Search time limit: 2 Search size limit: 100To adjust the limits globally for all queries, use the
ipa config-modcommand and add the--searchrecordslimitand--searchtimelimitoptions. For example:$ ipa config-mod --searchrecordslimit=500 --searchtimelimit=5To temporarily adjust the limits only for a specific query, add the
--sizelimitor--timelimitoptions to the command. For example:$ ipa user-find --sizelimit=200 --timelimit=120
4.4.2. Adjusting the search size and time limit in the Web UI Copy linkLink copied to clipboard!
You can adjust global search size and time limits using the IdM Web UI to optimize search performance and responsiveness.
Procedure
- Log in to the IdM Web UI.
- Click IPA Server.
- On the IPA Server tab, click Configuration.
Set the required values in the Search Options area.
Default values are:
- Search size limit: 100 entries
- Search time limit: 2 seconds
- Click Save at the top of the page.