SMS 2.0 Queries Overview

You can use a SMS query to search for information in the SMS site database. In fact, all data stored in the site database can be queried. This includes data relating to computer resources, sites, software distribution, and users and user groups. A query consists of one expression or multiple expressions conveyed using the WBEM Query Language (WQL). When the query is run against the SMS site database, the SMS Provider retrieves all data in the SMS site database tables that match the criteria defined in the expression. The results of the query are written to the SMS Administrator console.

There are a number of functions that you can use SMS queries for:

  • Find data in the SMS site database.

  • Find computers that meet specific criteria before sending packages.

  • Define collection memberships.

To create and run a query, the SMS Query Builder located within the SMS Administrator console is utilized. SMS 2.0 provides quite a number of predefined queries. You can though create and run your own SMS queries.

You can define a simple query by specifying the following:

  • The SMS object to search.

  • One or multiple attributes of the object.

  • An operator

  • A value

A SMS query is made up of a number of elements:

  • Attributes: The SMS site database contains numerous of attributes.

  • Attribute class: The attributes contained in the SMS site database are categorized by attribute class. A specific attribute class contains a list of attributes.

  • Object type: The Attribute classes belong to a category, called an object type. The attribute classes describe the object type. The predefined object types are:Using the Queries and Reports SMS Features

    • System Resource

    • Site

    • Package

    • Advertisement

    • Program

    • User Resource

    • User Group Resource

While the System Resource object type contains multiple attribute classes, the remainder of the object types only contain one attribute class.

  • Criterion type; defines what the attribute is being compared with.

  • Specify the relational operator and value to search for.

The different SMS object types and a few of their associated attribute classes and attributes are listed below:

  • System Resource object type:

    • Attribute Class:

      • Collected File

    • Attributes:

      • Collection Date

      • File Name

      • File Path

    • Attribute Class:

      • Logical Disk

    • Attributes:

      • File System

      • Free Space

      • Volume Name

    • Attribute Class:

      • Memory

    • Attributes:

      • Total Page file Space

      • Total Physical Memory

      • Total Virtual Memory

    • Attribute Class:

      • Network Adapter

    • Attributes:

      • Adapter Type

      • MAC Address

      • Manufacturer

    • Attribute Class:

      • Operating System

    • Attributes:

      • Build Number

      • Manufacturer

      • Version

    • Attribute Class:

      • Processor

    • Attributes:

      • Family

      • Manufacturer

      • Max Clock Speed

    • Attribute Class:

      • System Resource

    • Attributes:

      • IP Addresses

      • NetBIOS Name

      • Operating System Name And Version

  • Site object type:

    • Attribute Class:

      • Site

    • Attributes:

      • Build Number

      • Install Directory

      • Server Name

      • Site Code

      • Site Name

  • Package object type:

    • Attribute Class:

      • Package

    • Attributes:

      • Description

      • Manufacturer

      • Name

      • Package ID

      • Priority

  • Advertisement object type:

    • Attribute Class:

      • Advertisement

    • Attributes:

      • Advertisement ID

      • Advertisement Name

      • Collection ID

      • Package ID

      • Program Name

  • Program object type:

    • Attribute Class:

      • Program

    • Attributes:

      • Command Line

      • Comment

      • Disk Space Required

      • Package ID

      • Working Directory

  • User Resource object type:

    • Attribute Class:

      • User Resource

    • Attributes:

      • Full User Name

      • Resource ID

      • SMS Assigned Sites

      • User Name

      • Windows NT Domain

  • User Group Resource:

    • Attribute Class:

      • User Group Resource

    • Attributes:

      • Name

      • Resource ID

      • SMS Assigned Sites

      • User Group Name

      • Windows NT Domain

  • Software Product Compliance object type:

    • Attribute Class:

      • Software Product Compliance

    • Attributes:

      • Category

      • Product Company

      • Product Name

      • Product Version

      • Type

The different criterion types which you can specify are listed here:

  • Null Value; used to specify that the attribute value can be null or cannot be null.

  • Simple Value; used to specify a constant value against which the attribute is compared.

  • Prompted Value; used to specify that a value has to be prompted for before the query is run. This is the value to which the attribute is compared.

  • Attribute Reference; used to compare the query attribute to a different attribute which you specify.

  • Subselected Values; used to compare the query attribute to the results of a query.

  • List Of Values; used to specify a list of constant values against which the attribute is compared.

How to create a query

You use the SMS Query Builder located within the SMS Administrator console to create your own queries. The Query Builder can be accessed from the Queries node.

  1. Open the SMS Administrator console.

  2. Expand the Queries node to display existing queries.

  3. Right-click the Queries node and select New and then Query from the shortcut menu.

  4. The Query Properties dialog box opens.

  5. On the General tab, in the Name textbox, provide a name for the query which you are creating.

  6. If you want to copy or modify an existing query, click the Browse button to select the query.

  7. In the Comment box, provide a meaningful description.

  8. In the Collection Limiting section area of the General tab, you can select the following options:

    • Not Collection Limited option; this is the default option which results in the query being run against the entire SMS site database.

    • Limit To Collection option; and then specify the collection name.

    • Prompt For Collection option; results in the prompting of the collection name when the query runs.

  9. In the Object type box, provide the object type for the new query.

  10. Click the Edit Query Statement button.

  11. The Query Statement Properties dialog box opens.

  12. On the General tab, you need to define what the query results window will display in the SMS Administrator console during the running of the query.

  13. Click the New button to define an attribute class and an attribute.

  14. The Result Properties dialog box opens.

  15. Click the Select button.

  16. The Select Attribute dialog box opens.

  17. In the Attribute class drop-down list box, specify the attribute class.

  18. You can select an alias.

  19. In the Attribute drop-down list box, specify the attribute.

  20. Click OK to close the Select Attribute dialog box.

  21. When the Result Properties dialog box is displayed, you can define a sort order.

  22. Click OK in the Result Properties dialog box. Use the process just illustrated to specify all the attributes you want displayed when the query runs.

  23. The Query Statement Properties dialog box is displayed again.

  24. Click the Criteria tab.

  25. Click the New button to define the query criteria.

  26. The Criterion Properties dialog box opens.

  27. In the criterion type drop-down list, specify what the attribute will be compared to.

  28. Click the Select button.

  29. The Select Attribute dialog box opens.

  30. Select the attribute class and attributes, and then click OK.

  31. When the Criterion Properties dialog box is displayed, in the Operator drop-down list, chose the operator.

  32. Click the Value button.

  33. The Values dialog box opens, displaying all possible values.

  34. Select the appropriate value and then click OK. This value will be shown in the Value textbox on the Criterion Properties dialog box.

  35. Click OK in the Criterion Properties dialog box.

  36. The Query Statement Properties dialog box is displayed again.

  37. Click the Joins tab to display the database joins which are necessary for a query that contains attributes from different attributes classes.

  38. Click OK to close the Query Statement Properties dialog box.

  39. Click OK to the Query Properties dialog box.

How to create joins to different attribute classes

SMS automatically creates the links between different attribute classes as attributes from the different attribute classes that are selected. There may though be occasions where you have to manually create these links.

To create joins to different attribute classes;

  1. Open the SMS Administrator console.

  2. Expand the Queries node to display existing queries.

  3. Open the Query Statement Properties dialog box for the query.

  4. Click the Joins tab.

  5. Click the New button.

  6. The Attribute Class Join Properties dialog box opens.

  7. In the Type drop-down select the join type:

    • Inner; displays only the matching results.

    • Left; displays all results for the base attribute and any matching results for the join attribute.

    • Left; displays all results for the join attribute and any matching results for the base attribute.

    • Full; displays all results for join attribute and for the base attribute.

  1. Click the Select button located beneath the Join Attribute textbox to specify an attribute class and attribute.

  2. In the Select Attribute dialog box, specify the attribute class and attribute. This will be displayed in the Join Attribute text box.

  3. Click OK to close the Select Attribute dialog box.

  4. In the Operator drop-down list, select the relational operator.

  5. Click the Select button located beneath the Base Attribute textbox to specify the base attribute.

  6. When the Select Attribute dialog box opens, select the base attribute. This will be displayed in the Base Attribute textbox.

  7. Click OK to close the Select Attribute dialog box.

  8. Click OK to close the Attribute Class Join Properties dialog box.

  9. Click OK to close the Query Statement Properties dialog box.

How to edit existing queries

Existing queries are edited on the Criteria tab of the Query Statement Properties dialog box. The toolbar located on the Criteria tab can be used to perform a number of tasks to edit an existing query:

  • Add new criteria

  • Change the properties of a specific criterion.

  • Delete a specific criterion.

  • Set parentheses around a specified list of criteria.

  • Remove parentheses from a selected list of criteria.

  • Toggle the AND and OR operator to connect criteria.

  • Toggle the NOT operator on or off.

How to run a SMS query

After you have created an SMS query, you need to access the Queries node in the SMS Administrator console to run the query. All query results are displayed in the details pane of the SMS Administrator console.

To run a query;

  1. Open the SMS Administrator console.

  2. Expand the Queries node to display existing queries.

  3. Right-click the specific query which you want to run and then select Run Query from the shortcut menu.

  4. The Input Query Value dialog box is displayed for a query that contains prompts. Provide the necessary value and then click OK.

  5. After the query executed, the query results are displayed in the details pane of the SMS Administrator console.

SMS 2.0 Reports Overview

SMS 2.0 includes Crystal Info 6.0, which is the report building tool available with SMS. Crystal Info can be used to create a number of reports which are based on data stored within the SMS site database. Once Crystal Info is installed, you can use the default reports provided, or you can design your own reports. You can also schedule reports to run against the data stored in the SMS site database.

Crystal Info is integrated with the SMS Administrator console. However, you have to install Crystal Info either when performing an Express setup installation or a Custom setup installation; or after you have installed SMS.

When you install Crystal Info, three Crystal Info services are installed on the SMS primary site server, or on another Windows computer residing in the SMS site.

The three Crystal Info services installed when you install Crystal Info are:

  • Info Agent: This is the main SMS reporting service that performs a number of functions:

    • Coordinates the activities of the other Crystal Info services (Info APS service, Info Sentinel service)

    • Processes the activities of the other Crystal Info services

    • Processes user requests

    • Processes files associated with reports

    • Deals with permissions needed to run reports

    • Manages configuration information

    • Manages scheduling information.

    • Manages SMS reporting auditing

  • Info APS: Responsible for passing requests to view a report to the Info Agent service.

  • Info Sentinel: Facilitates communication between the Info Agent service and the user running the report.

The different report types are listed here:

  • Cross-tab

  • Drill-down

  • Form

  • Form letter

  • Mail label

  • Online Analytical Processing (OLAP)

  • Subreport

  • Standard chart

The default reports that are created when you install Crystal Info are located beneath the Tools node in the SMS Administrator console.

The default reports are categorized as follows:

  • Configuration

  • Hardware Inventory

  • Product Compliance

  • Queries

  • Status

How to generate a report using Crystal info

  1. Open the SMS Administrator console.

  2. Expand the Tools node.

  3. Expand the Reports node.

  4. Right-click the report that you want to run and select All Tasks and then Schedule Report from the shortcut menu.

  5. The Schedule Report Properties dialog box is displayed.

  6. If you want to modify how the report is displayed, click the Modify button on the General tab of the Schedule Report Properties dialog box.

  7. When the Info Report Designer dialog box opens, proceed to modify the appearance of the displayed report, and then click OK.

  8. In the Schedule Report Properties dialog box, click the Refresh button on the General tab to update the report filename in the Description text box.

  9. Click the Schedule tab.

  10. In the Time area of the Schedule tab, choose between the following options to specify when the report should run:

    • Not Scheduled

    • Right Now

    • At Time option, and then specify the time.

  1. In the Recurrence drop-down list box, specify the recurrence pattern.

  2. Click the Accounts tab.

  3. In the Logon User Name textbox, the name of the user currently logged on is displayed. Provide the associated password if this account has the necessary permissions to run the report. If the account does not have sufficient permissions to run the report, then provide the account that does have the necessary permissions and specify the password.

  4. Click the Selection Formula tab.

  5. Click the Edit Selection Formula button if you need to edit the query statement used to create the data for the report.

  6. Click the Prompts tab.

  7. This is where you set which prompted values the user has to provide before the report can be generated.

  8. Click OK.

How to create a report using Crystal info

  1. Open the SMS Administrator console.

  2. Expand the Tools node.

  3. Expand the Reports node.

  4. Right-click any report under the Reports node and select All Tasks and then Design New Report from the shortcut menu.

  5. The Info Report Designer is initiated.

  6. On the Info Report Designer welcome dialog box, click New Report, to start creating your new report.

  7. The Report Gallery dialog box opens.

  8. Specify the type of report which you want to create.

  9. The Create Report Expert dialog box opens. This is where you create the display of the report.

  10. On the Data tab of the Create Report Expert dialog box, click the SQL/ODBC button to define the data source.

  11. When the Log On Server dialog box opens, specify the data source, and then click OK.

  12. After you have specified the data source, the Configure Connection dialog box opens automatically.

  13. In the Login properties area, in the User name textbox, provide the user account details that have the necessary access to the data.

  14. In the Password textbox, provide the password associated with the user account specified.

  15. In the Server name textbox, provide the name of the SMS database server name, and then click Connect.

  16. After a connection is successfully established, the Namespace Selection box will show a tree structure that starts with the entry Root. Click OK.

  17. The Choose SQL Table dialog box opens next.

  18. Add each table that must be used for the report, and click the Done button once you have added all the necessary reports.

  19. The Create Report Expert dialog box is displayed.

  20. On the Links tab, choose the link for your report and delete the links which you do not need.

  21. Click the Options button after you have selected the appropriate link.

  22. The Link Options dialog box opens.

  23. Specify the join which should be created between the tables and then click OK.

  24. When the Create Report Expert dialog box is displayed, click the Fields tab.

  25. Specify which fields should be displayed when the report is generated.

  26. Use the remaining tabs of the Create Report Expert dialog box to define any additional settings for the report. The tabs are listed here:

    • Sort tab

    • Total tab

    • TopN tab

    • Drill tab

    • Graph tab

    • Select tab

    • Style tab.

  1. After adding all necessary settings for the report, click the Preview Report button located at the bottom of the Create Report Expert dialog box to view the display of the report.

  2. If you need to modify the display, click the Info Report Design menu, click Format, and then click Report Style Expert.

  3. To save the report template which you have created, click the Preview Report button, and then click File and select the Save option from the Info Report Design menu.

How to edit an existing report

  1. Open the SMS Administrator console.

  2. Expand the Tools node.

  3. Expand the Reports node.

  4. Right-click the report that you want to edit and click All Tasks and then Modify Report from the shortcut menu.

  5. The Info Report Designer tool starts with the report that you have selected loaded.

  6. Before you can make modifications to the report, you have to connect to the WBEM data source server.

  7. After the connection to the WBEM data source server has been established, you can proceed with making the required changes.

  8. When you are ready to save the report, first click the File menu and then click Options.

  9. The Options Properties dialog box is displayed.

  10. Click the Reporting tab.

  11. Check that the Save Data With Report checkbox is not selected. Click OK.

  12. In the SMS Administrator Console, right-click the report that you are working with, and select All Tasks and then Schedule Report from the shortcut menu.

  13. The Schedule Report Properties is displayed.

  14. Click the Refresh button on the General tab.

  15. Run the report to create a new report that includes the modifications you have made.

Organizing Reports in Report Folders

How to create report folders to organize reports

  1. Open the SMS Administrator console.

  2. Expand the Tools node.

  3. Expand the Reports node.

  4. Right-click the Reports node and select New and then select Folder from the shortcut menu.

  5. The Seagate Crystal Info dialog box opens.

  6. Provide a name for the new report folder and then click OK.

  7. The new report folder is displayed beneath the Reports node.

How to add a report to a report folder

  1. Open the SMS Administrator console.

  2. Expand the Tools node.

  3. Expand the Reports node.

  4. Right-click the report folder to which you want to add a report and select New and then select Report Object from the shortcut menu.

  5. The New Report Object Properties dialog box opens.

  6. In the Report File textbox, provide the path to the specific report that you want to add to the report folder.

  7. In the Title textbox, provide a title.

  8. In the Comment textbox, provide a description.

  9. Click OK to add the report to the report folder.