Landesk-Creating-Queries

advertisement
Page 1
What are Queries?
A query is a search that you design to filter and find information that you want to display.
Things to remember about queries:

Queries display information that is gathered during a Landesk inventory scan

The information gathered during the inventory scan is put into categories (Landesk calls them “objects”)
or fields (Landesk calls them “attributes”)

To display the fields you can use in a query, pick a machine in Landesk and double click on it. You will
see inventory information similar to the graphic below. These are the categories and fields you will use
in a query. Double-click on a field to see some of the information in it.

Landesk queries help you manage your school network by allowing you to search for and organize a
computer’s hardware, software, device drivers, memory, and its environment.

In most cases, the information you want will be related to your computer hardware. However, you can
get information about a) the software on a machine, b) the software used at your school, c) device
drivers, and d) some user or computer AD info (limited).

Most queries in Landesk use “logical” or “mathematical” operators or connectors (“like”, “not like”, =,
>,<, etc) to get the data you want.
Page 2
Building a Query
1. Open up your Landesk
console.
2. Make sure you are in
Network View
3. Locate the Queries section.

Notice the “My queries”
folder just below the
Queries section.
4. Right mouse click on My
Queries
5. Select New Query.
Page 3
6. The NewQuery window
opens up.

Landesk presents you
with a lot of fields and
sub-fields (on the left)
that you can use in a
query.
7. Type in a descriptive name
for the query. Start it with
your school number.

Example:
5011 Lenovo Computers

Notice the word
“Computer”

There are lots of
“things” (objects) listed
under Computer.

Each of these objects
contain “fields” and data
about your computer.

Some commonly used
objects are obvious:
OS, Software, Memory

Other useful objects are
not so obvious:
System, Network, LDAP
location
Page 4
8. Scroll down to “System” and
click on the + (plus) to expand
the options under System

We choose System under
Computer because we want the
field that contains the
Manufacturer of the “computer”
“system”
9. Click on the word
“Manufacturer”

Notice that Landesk has
started to build a
“question” (query) in a
language it understands.

Notice that it uses the
fields we selected.
Page 5
10. Click on the word “Like” in
the middle column

Notice that the word
“Like” is added to the
query below
11. If you have a check in the
“Display scanned values”
box, a list of choices
gathered from all of your
school’s machines will
appear in the far right
column.
12. Double-click on “LENOVO”
to select it and add it down
below.

You could also type in
the word Lenovo in the
“Edit Values” box in the
right column
Page 6
13. Click on the INSERT button
to insert your query into the
query box below.

Notice the equation is now
complete and makes
sense.
14. Click the SAVE button to save
your query.
15. The saved query appears
under the My queries
section.
16. Double-click on it to run the
query.
Page 7

The results of the query
appear and will look similar
to this

In the lower left corner of
your console, you will see
how many items met your
query.
Page 8
Building a Multi-Part Query
(Example: Finding All Laptops)
1. Open up your Landesk
console.
2. Make sure you are in
Network View
3. Locate the Queries section.

Notice the “My queries”
folder just below the
Queries section.
4. Right mouse click on My
Queries
5. Select New Query.
Page 9
6. The NewQuery window
opens up.
7. Name the Query starting
with your school number.
5011 ALL Laptops
8. Locate the “System”
section of the Machine
Components
9. Highlight or click the
“Chassis Type” field
10. Click the = (equals)
operator in the middle
column
11. Click the word “Notebook”
in the scanned values
column
12. Click the Insert Button in
the lower left.

Notice the “equation” that
appears below the Insert
button
Page 10
13. Click on the AND drop-down
box and select the word “OR”
14. Click the Insert button to add
a second condition

Notice the second part of the
“equation” appears

The two parts of the equation
are separated by the word
OR

Notice that the first equation
is duplicated and the word
“Notebook” appears twice

“OR” means that only 1 of the 2 sides of the equation needs to be true for the query
to find the computer

“AND” means that both part 1 and part 2 needs to be true for the query to find the
computer
Page 11
15. Highlight the equation that
starts with the word “OR”
16. Click Edit
17. Change the word
“Notebook” to “Portable”
by selecting it from the
scanned values
18. Click the UPDATE button
to change the bottom line
to the correct value.
Page 12
19. Click the SAVE button to
finalize the query.
20. Run the query.
Editing a Query
1. To edit the query, open up
the query
2. Highlight the part of the
query you want to edit
3. Click on the EDIT button.
4. Change the value you want
to modify
5. Click UPDATE when done.
6. Save the Query.
Page 13
Selecting Columns In a Query
1. Right mouse click on the Query
you want to modify and click on
Properties from the context menu.

If you are in the middle of creating
a query from scratch, you can skip
this step
2. Click on Select Columns in the
lower right.

If you are in the middle of creating
a query from scratch, you can
continue formatting the query by
following this step
3. The current layout appears in
Section A of the picture to the
right.

Remove items from the current
layout (A) by highlighting them &
using the << button in Section C.

Add items from the inventory
objects in Section B to the current
layout in Section A by highlighting
the item & using the >> button in
Section C. Click Save when done.
Page 14
Column Sets
Column Sets let you customize the way your Landesk data is displayed for queries and for your
devices. The column set that you use will be displayed in the right pane of the network view. The
data in the right panel shows information gathered from the inventory scans that are run in Landesk.
Things to remember about column sets:

Click on Tools, Administration, Column Set Configuration to create a column set.

In the Column Sets window near the lower part of your screen, right mouse click no My Column
Sets and create as many different column sets as you like.

Start each column set with your school number.

The data displayed in a column set shows the most recent data gathered in an inventory scan.

If you see the word “unknown” in a field, it could be due to an incomplete inventory scan

The default column set shows the Device Name, Device Type, and OS Name attributes or fields.
You can create your own column set & drag it on top of the query or device group to change it.

In general, limit column sets that contain “software application” attributes to queries involving
software. Dropping such a column set on a device group or a computer-only related query may
show lots of duplicate computers or laptops and hundreds or thousands of software applications.
Page 15
Creating Column Configuration Sets
1. Click on Tools from the
Landesk Menu.
2. Click on Administration
3. Click on Column Set
Configuration
4. The Column Sets window
opens up.

Expand the My Column Sets
Group as you will create your
custom column sets here
5. Right mouse click on the My
Column Sets Group
6. Select New Column Set
Page 16
7. The Column Configuration
Window opens up. This is
where you will add fields to
create a Basic Landesk Column
Configuration

Name your configuration (A) with a
name you can easily understand
starting with your school number.

Remove any field names in
Section D that you don’t want.
Highlight the field you want to
remove & use the Remove button
in Section E

Highlight, in Section B, any new
fields you want to add and click the
Add to Columns Button (C). The
new fields will appear in Section D.

Repeat this last step until you have
all the fields you want for your
layout.

Highlight any fields in Section D
that you want to move up/down &
use the buttons in Section E to do
so.
8. Click OK when done. This will
save your column set under the
My Column Sets Group.
9. Drag you custom column set
and drop it on any query or on
All Devices or any of your
custom device groups.

You can create as many custom
column sets as you wish & use
them to display data in different
ways.
Page 17
Using Regular Expressions in Queries
A regular expression is a shorthand way of matching a pattern or string of text and/or numbers in your
query. It is used in the Edit Values area of the query where you can either pick a value or type one in.
For example, you may want to search for Microsoft Office 2003 and 2007. You see that these numbers
appear at the end of the scanned values in the Application Suite.name field in Landesk. You could
build a query for Office 2003 and add another query phrase to it searching for Office 2007 and you
should be able to get the results you want. But you can simplify the query by using a regular
expression (do not use the quotes):
"Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft Office Prof*[2007|2003]"
This query explained:
"Computer"."Software"."Application
Suites"."Application Suite"."Name"
Means click on the Software object, then the Application
Suites object under the Software object. Next locate the
Name field under the Application Suite.
LIKE
It is often best to choose the LIKE operator (or NOT LIKE)
when using regular expressions.
Microsoft Office Prof
You want to search for the string “Microsoft Office Prof” so
you type this in.
*
The asterisk is a regular expression wildcard that means
anything that follows until the end of the line or whatever
comes next.
[2007|2003]
The line ends with either 2007 or 2003. The brackets [ ]
and the | (above the Enter key meaning OR) are regular
expression shortcuts

This query searches for Microsoft Office XP, both Professional and Standard edition:
"Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft Office XP [P|S]*"
Explained: Looking for an Application whose “name” starts with "Microsoft Office XP “ and then the
next letter will either be a P (for Professional) or an S (for Standard) followed by any other letters or
numbers (represented by the asterisk) until the end of the application name is reached.
Page 18

This query searches for Microsoft Office Professional (any version) and Office XP Pro & Standard:
"Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft
Office [P|X][r|P][o| ][f|P|S]*"
Explained: Looking for an Application whose “name” starts with "Microsoft Office “ Now carefully
follow the 4 sets of brackets. The first letter of each bracket spells out “Prof” (for Professional) and
the second letter of each bracket spells out “XP P” (for XP Professional) or “XP S” (for XP Standard)
followed by any other letters or numbers (represented by the asterisk) until the end of the application
name is reached.
So it will find "Microsoft Office Prof”essional of any type – both 2003 and 2007 and "Microsoft Office
XP P”rofessional and "Microsoft Office XP S”tandard

This query searches for desktop computers by eliminating Notebooks, Portables, and Main Server
Chassis:
"Computer"."System"."Chassis Type" NOT LIKE "[N|P|M][o|o|a]*"
Explained: Looking for an Computer chassis type that does not start with a) No (first letter of first bracket +
first letter of second bracket) – Notebooks or (the | means “or”) does not start with b) Po (second letter of first
bracket + second letter of second bracket) – Portable or does not start with c) Ma (third letter of first bracket +
third letter of second bracket) followed by any other letters or numbers (represented by the asterisk) until the
end of the chassis type is reached.
More regular expressions:

Device Name begins with S, has two numbers, and then an A:
o "Computer"."Device Name" LIKE s[0-9][0-9]a*

Device Name begins with S or A or P, followed by any letter:
o "Computer"."Device Name" LIKE [s|a|p][a-z]*

Device Name ends with X or 42:
o "Computer"."Device Name" LIKE *[X|42]

Device Name begins with three letters, followed by an O:
o "Computer"."Device Name" LIKE [A-Z][A-Z][A-Z][O]*

Device Name begins with three letters, followed by an O: The third octet in the IP address is 15:
o "Computer"."Network"."TCPIP"."Address" LIKE [0-9][0-9][0-9].[0-9][0-9][0-9].015.[09][0-9][0-9]
Page 19
Sample Queries
Note: Do NOT use the quotes in you queries
1. How many computers have less than 1 GB of Hard Drive Space?

"Computer"."Mass Storage"."Logical Drive"."Drive Letter" = "C" AND "Computer"."Mass
Storage"."Logical Drive"."Available Storage" < "1000 MB"
2. How many computers have Office 2007? Two versions:

GOOD
"Computer"."Software"."Application Suites"."Application Suite"."Name" = "Microsoft Office
Professional Plus 2007"

BETTER "Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft
Office Prof*[2007]"
3. How many computers have either Office 2003 or 2007?

"Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft Office
Prof*[2007|2003]"
4. How many computers have either Office 2003 or 2007 or Office XP?

"Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft Office XP
[P|S]*" OR "Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft
Office Prof*[2007|2003]"
5. How many computers have either Office 2003 or 2007 or Office XP? – Uses Only Regular Expressions

"Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft Office
[P|X][r|P][o| ][f|P|S]*"
6. How many computers have Office XP (Office 2002)?

"Computer"."Software"."Application Suites"."Application Suite"."Name" LIKE "Microsoft Office XP
[P|S]*"
7. How many of your computers are NOT in Domain Computers Group?

"Computer"."LDAP Groups"."Machine"."Name" NOT LIKE "Domain Computers"
Page 20
8. How many student desktop computers are there at Cocoa Beach?

NORMAL Way:
"Computer"."Network"."TCPIP"."Host Name" LIKE "5011S-" AND
("Computer"."System"."Chassis Type" NOT LIKE "Portable" AND "Computer"."System"."Chassis Type"
NOT LIKE "Notebook" AND "Computer"."System"."Chassis Type" NOT LIKE "Main Server Chassis")

REGULAR Expression:
"Computer"."Network"."TCPIP"."Host Name" LIKE "5011S-" AND
"Computer"."System"."Chassis Type" NOT LIKE "[N|P|M][o|o|a]*"
9. How many Teacher Desktop Computers at Cocoa Beach do not have GradeCam?

Normal Way:
"Computer"."Network"."TCPIP"."Host Name" LIKE "5011T-" AND
"Computer"."Software"."Application Suites"."Application Suite"."Name" <> "GradeCam" AND
("Computer"."System"."Chassis Type" NOT LIKE "Portable" AND "Computer"."System"."Chassis Type"
NOT LIKE "Notebook" AND "Computer"."System"."Chassis Type" NOT LIKE "Main Server Chassis")

Regular Expression:
"Computer"."Network"."TCPIP"."Host Name" LIKE "5011T-" AND
"Computer"."System"."Chassis Type" NOT LIKE "[N|P|M][o|o|a]*" AND
"Computer"."Software"."Application Suites"."Application Suite"."Name" <> "GradeCam"
10. How many teacher laptops at Cocoa Beach (presuming they are in the Computers/Teachers OU in AD)

"Computer"."System"."Chassis Type" = "Notebook" AND "Computer"."Computer Location" =
"Brevardschools.org/High Schools/5011 Cocoa Beach/Computers/Teachers"
11. List all the computers in the D121 OU in AD

"Computer"."LDAP Location" LIKE "OU=D121"
12. How many laptops do you have?

GOOD
"Computer"."System"."Chassis Type" = "Notebook" OR "Computer"."System"."Chassis
Type" = "Portable"

EASIER
"Computer"."System"."Chassis Type" LIKE "[N|P]*"
13. How many machines have SiteReporter?

"Computer"."Software"."Application Suites"."Application Suite"."Name" = "SiteReporter Web" AND
"Computer"."Software"."Application Suites"."Application Suite"."Publisher" = "Edline"
14. How many Lenovo-IBM 8382 Models do I have?

"Computer"."System"."Board Name" LIKE "8382"
15. How many machines have Windows 7?

"Computer"."OS"."Name" LIKE "Microsoft Windows 7*"
Page 21
Download