Queries are customized searches for managed devices.
LANDesk Management
Suite provides a method for you to query devices that have
been scanned into your core database via database queries, as well
as a method for you to query for devices located in other
directories via LDAP queries. You view, create and organize
database queries with the Queries groups in the console's network
view. You create LDAP queries with the Directory Manager tool.
For more information on creating and using LDAP directory
queries with Directory Manager, see LDAP queries.
Queries help you manage your network by allowing you to search
for and organize network devices that are in the core database,
based on specific system or user criteria.
For example, you can create and run a query that captures only
devices with a processor clock speed of less than 2 GHz, or with
less than 1024 MB of RAM, or a hard drive of less than 20 GB.
Create one or more query statements that represent those conditions
and relate statements to each other using standard logical
operators. When the queries are run, you can print the results of
the query, and access and manage the matching devices.
Query groups
Queries can be organized into groups in the network view. Create
new queries (and new query groups) by right-clicking the My
queries group and selecting New query or New
group, respectively.
A Management Suite
administrator (user with Management Suite Administrator
rights) can view the contents of all of the query groups, including
My queries, Public queries, and All
queries.
When other Management
Suite users log in to the console, they can see queries in
the My queries, Public queries, and All
queries groups, based on their device scope.
When you move a query to a group (by right-clicking and
selecting Add to new group or Add to existing group),
or by dragging and dropping the query, you're actually creating a
copy of the query. You can remove the copy in any query group and
the master copy of the query (in the All queries group)
isn't affected. If you want to delete the master copy, you can do
it from the All queries group.
For more information on how query groups and queries display in
the network view, and what you can do with them, see Understanding the network view.
Creating database queries
Use the New query dialog to build a query by selecting
from attributes, relational operators, and the attribute's values.
Build a query statement by choosing an inventory attribute and
relating it to an acceptable value. Logically relate the query
statements to each other to ensure they're evaluated as a group
before relating them to other statements or groups.
To create a database query
In the console's network view, right-click the My
queries group (or Public queries, if you have the public
query management right), and then click New query.
Enter a unique name for the query.
Select a component from the inventory attributes
list.
Select a relational operator.
Select a value from the values list. You can edit a
value.
Click Insert to add the statement to the query
list.
If you want to query for more than one component,
click a logical operator (AND, OR) and repeat steps
2-5.
(Optional) To group query statements so they're
evaluated as a group, select two or more query statements
and click Group().
When you're finished adding statements, click
Save.
About the New query dialog box
Use this dialog box to create a new query with the following
functions:
Name: Identifies the query in query
groups.
Machine components: Lists inventory components
and attributes the query can scan for.
Relational operators: Lists relational
operators. These operators determine which description values for a
certain component will satisfy the query.
The Like operator is a new relational operator.
If a user doesn't specify any wild cards (*) in their query, the
Like operator adds wildcards to both ends of the string. Here are
three examples of using the Like operator:
Computer.Display Name LIKE "Bob's Machine"
queries for: Computer.Display Name LIKE "%Bob's Machine%"
Computer.Display Name LIKE "Bob's Machine*"
queries for: Computer.Display Name LIKE "Bob's Machine%"
Computer.Display Name LIKE "*Bob's Machine"
queries for: Computer.Display Name LIKE "%Bob's Machine"
Display scanned values: Lists acceptable
values for the chosen inventory attribute. You can also manually
enter an appropriate value, or edit a selected value, with the Edit
values field. If the selected relational operator is Exists or Does
Not Exist, no description values are possible.
Logical operator: Determines how query
statements logically relate to each other:
AND: Both the previous query statement and the
statement to be inserted must be true to satisfy the query.
OR: Either the previous query statement or the
statement to be inserted must be true to satisfy the query.
Insert: Inserts the new statement into the
query list and logically relates it to the other statements
according to the listed logical operator. You can't choose this
button until you've built an acceptable query statement.
Edit: Lets you edit the selected query
statement. When you're finished making changes, click the
Update button.
Delete: Deletes the selected statement from
the query list.
Clear all: Deletes all statements from the
query list.
Query list: Lists each statement inserted into
the query and its logical relationship to the other listed
statements. Grouped statements are surrounded by parentheses.
Group (): Groups the selected statements
together so they're evaluated against each other before being
evaluated against other statements.
Ungroup: Ungroups the selected grouped
statements.
Filters: Opens the Query Filter dialog box
that displays device groups. By selecting device groups, you limit
the query to only those devices contained in the selected groups.
If you don't select any groups, the query ignores group
membership.
Select columns: Lets you add and remove
columns that appear in the query results list for this query.
Select a component, and then click the right-arrow button to add it
to the column list. You can manually edit the Alias and Sort Order
text, and your changes will appear in the query results list.
Qualifier: The qualifier button is used to
limit the results of one-to-many relationships in the database;
without it, you will get the same machine listed numerous times in
your result set. For example, if you want to see which version of
Microsoft Word is installed on every device in your organization,
you would insert Computer.Software.Package.Name = 'Microsoft Word'
in the query box and select Computer.Software.Package.Version in
the Select Columns list. However, simply listing the software
version will list every version of every piece of software
installed on each device, which you don't want. The solution is to
limit (or qualify) the version to only Microsoft Word. Click the
Qualify button to insert Computer.Software.Package.Name ="Microsoft Word". This will return only the versions of Microsoft
Word.
Save: Saves the current query. When you save
a query before running it, the query is stored in the core database
and remains there until you explicitly delete it.
NOTE:Query
statements are executed in the order shown
If no groupings are made, the query statements listed in this
dialog are executed in order from the bottom up. Be sure to group
related query items so they're evaluated as a group; otherwise, the
results of your query may be different than you expect.
Running database queries
To run a query
In the network view, expand the query groups to
locate the query you want to run.
Double-click the query. Or, right-click and select
Run.
The results (matching devices) display in the
right-hand pane of the network view.
Importing and
exporting queries
You can use import and export to transfer queries from one core
database to another. You can import:
Management
Suite 8 and 9 exported queries
Web console exported XML queries
To import a query
Right-click the query group where you want to place
the imported query.
Select Import from the shortcut menu.
Navigate to the query you want to import and select
it.
Click Open to add the query to the selected
query group in the network view.
To export a query
Right-click the query you want to export.
Select Export from the shortcut menu.
Navigate to the location where you want to save the
query (as an .ldms file).