Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
PREGNANCY
 
 
Windows Server

Microsoft Systems Management Server 2003 : Queries (part 3) - Executing Queries

2/15/2013 6:07:18 PM
Combining Attributes

The Joins tab of the Query Statement Properties dialog box, shown in Figure 11, displays the links made between the attribute classes. This linking is done for the most part automatically by SMS as you select attributes from different attribute classes. Sometimes, however, because of the nature of the query, you might need to create joins between different attribute classes manually.

Figure 11. The Joins tab.


To create your own joins to different attribute classes, follow these steps:

1.
Select the Joins tab and click the New button to display the Attribute Class Join Properties dialog box, shown in Figure 12.

Figure 12. The Attribute Class Join Properties dialog box.


2.
In the Type drop-down list, select the join type. Four types of attribute class joins exist in SMS:

  • Inner —Displays only matching results

  • Left —Displays all results for the base attribute and matching results for the join attribute

  • Right —Displays all results for the join attribute and matching results for the base attribute

  • Full —Displays all results for both the base and the join attributes

3.
To select an attribute class and attribute for the Join Attribute text box, click Select to display the Select Attribute dialog box, where you can select appropriate entries from the drop-down lists. The attribute you specified will be connected to the base attribute and becomes a child of the base attribute.

4.
Choose an appropriate relational operator from the Operator dropdown list.

5.
To fill in the Base Attribute text box, click Select to display the Select Attribute dialog box and choose the appropriate base attribute. The base attribute class is an existing attribute class on which you based the query. Notice that you can’t change the base attribute class; you can change only the base attribute.

6.
Click OK to close and save your query configuration.

7.
Click OK again to save the query.

Viewing the Query Language

Figure 13 shows our sample query using WQL. You can display the WQL version of any query by clicking Show Query Language in the General, Criteria, or Join tab of the Query Statement Properties dialog box. As you can see, writing an SMS 2003 query using WQL is not trivial.

Figure 13. The WQL version of our sample query.


Prompted Queries

The query we just created will satisfy our immediate quest for information from the SMS database. However, it’s static in the sense that it will always check the database for the same information—that is, all computers running Windows 2000 Server that have at least 2 GB of free disk space.

A more useful query would be one that prompts us for value information as the query is being evaluated. For example, instead of hard-coding the value 2000, it might be more useful to have the query prompt us for the Size value. This way, we can use the query repeatedly to find computers with different amounts of free space for different packages and purposes.

To change our query to a prompted query, we need to open it and modify it. You can modify any query by right-clicking it in the SMS Administrator Console and choosing Properties from the context menu to display the Query Properties dialog box. Click Edit Query Statement to return to the Query Statement Properties dialog box, select the Criteria tab, and then double-click the element you want to modify to display the Criterion Properties dialog box. In the example shown in Figure 14, we’re modifying the Size value. The criterion type has been changed from Simple Value to Prompted Value.

Figure 14. An example of a prompted query.


Compare this figure with Figure 16-9, and you’ll see that the Value field has changed to indicate a prompted value. When this query is executed, it will first ask us to provide the value for Logical Disk-Free Space (MBytes).

3. Executing Queries

Now that we’ve seen how to create a query, it’s time to explore how to run a query. All SMS queries are run through the SMS Administrator Console. The results of the queries will also be displayed in the SMS Administrator Console.

To execute our sample query, follow these steps:

1.
In the SMS Administrator Console, navigate to the Queries folder.

2.
Right-click the query you want to run and choose Run Query from the context menu.

3.
If the query contains any prompts, the Input Query Value dialog box appears, as shown in Figure 15. Enter the appropriate value and click OK.

Figure 15. The Input Query Value dialog box.


4.
You can view the results of the query in the result pane of the SMS Administrator Console interface, shown in Figure 16. You’ll need to scroll to the right to see all the result fields you chose to display.

Figure 16. The query results.

As with other SMS-managed objects, such as collections, packages, and advertisements, only users who have access to the database objects will be able to run the query. The user must have rights to execute the SMS Administrator Console, rights to access the Queries folder, and rights to access data in the SMS database. This permission is assigned by applying object security through the SMS Administrator Console or sometimes through the WMI itself.

Other -----------------
- Microsoft Systems Management Server 2003 : Custom SMS Administrator Consoles
- System Center Configuration Manager 2007 : Operating System Install Packages and Image Packages (part 2) - Manual Image Creation, Image Deployment
- System Center Configuration Manager 2007 : Operating System Install Packages and Image Packages (part 1) - Automated Image Creation and Capture
- System Center Configuration Manager 2007 : Operating System Deployment - Computer Associations
- Microsoft Exchange Server 2007 : Load Balancing in Exchange Server 2007
- Microsoft Exchange Server 2007 : Managing a Windows Server 2003 Cluster
- BizTalk Server 2009 : Editing and Resubmitting Suspended Messages (part 2) - Pseudo-Walkthrough to Perform Edits and Resubmits
- BizTalk Server 2009 : Editing and Resubmitting Suspended Messages (part 1) - Sample Flows for Edit and Resubmit
- BizTalk Server 2009 : Building a Resequencing Aggregator
- Windows Server 2003 on HP ProLiant Servers : Security Planning and Design (part 3) - Microsoft Software Update Service and Windows Update Service
- Windows Server 2003 on HP ProLiant Servers : Security Planning and Design (part 2) - Account Lockout
- Windows Server 2003 on HP ProLiant Servers : Security Planning and Design (part 1)
- Developing with SharePoint 2010 (part 4) - Developer Toolbar
- Developing with SharePoint 2010 (part 3) - Server Object Model
- Developing with SharePoint 2010 (part 2) - SharePoint Fundamentals
- Developing with SharePoint 2010 (part 1) - Platform Development Tools, Development Server Configuration
- SQL Server 2008 R2 : Creating and Managing Stored Procedures - Viewing Stored Procedures
- SQL Server 2008 R2 : Creating and Managing Stored Procedures - Deferred Name Resolution
- Using Microsoft SharePoint with Microsoft Dynamics CRM Functions (part 2) - Displaying Data Using BDC in Microsoft Office SharePoint Server
- Using Microsoft SharePoint with Microsoft Dynamics CRM Functions (part 2) - Displaying Data Using BDC in Microsoft Office SharePoint Server
 
 
Most view of day
- Microsoft Dynamics CRM 2011 : Using Advanced Find (part 1) - Performing Advanced Find Queries
- Microsoft Systems Management Server 2003 : Creating Packages for Distribution (part 4) - Creating a Package from Scratch - Creating Programs
- Administering an Exchange Server 2013 Environment (part 2) - Exchange Administration Center - Overview of the Exchange Administration Center
- Extending the Real-Time Communications Functionality of Exchange Server 2007 : Exploring Office Communications Server Tools and Concepts
- Microsoft Dynamic CRM 4 : Data Migration (part 4) - Creating a Data Migration
- Using Microsoft SharePoint with Microsoft Dynamics CRM Functions (part 1) - Displaying Data in SharePoint Using the List Web Part for Microsoft Dynamics CRM 4.0
- Communicating with Internet Email : Working with Identities
- SQL Server 2012 : Understanding Latches and Spinlocks (part 2) - Latching Example - Without Latching
- Creating DVD Movies with Windows DVD Maker (part 2) - Adding Photos and Videos to Your DVD Project - DVD Storage Issues and Formats , Arranging Content
- Windows Phone 8 : Messaging - Composing a New Message (part 8) - Checking for New Mail
Top 10
- Microsoft Project 2010 : Linking Tasks (part 8) - Auditing Task Links,Using the Task Inspector
- Microsoft Project 2010 : Linking Tasks (part 7) - Creating Links by Using the Mouse,Working with Automatic Linking Options
- Microsoft Project 2010 : Linking Tasks (part 6) - Creating Links by Using the Entry Table
- Microsoft Project 2010 : Linking Tasks (part 5) - Creating Links by Using the Task Information Dialog Box
- Microsoft Project 2010 : Linking Tasks (part 4) - Entering Leads and Lags, Creating Links by Using the Menu or Toolbar
- Microsoft Project 2010 : Linking Tasks (part 3) - Using the Start-to-Start Relationship,Using the Finish-to-Finish Relationship
- Microsoft Project 2010 : Linking Tasks (part 2) - Using the Start-to-Start Relationship,Using the Finish-to-Finish Relationship
- Microsoft Project 2010 : Linking Tasks (part 1) - Defining Dependency Links
- Microsoft Project 2010 : Defining Task Logic - Manipulating Your Schedule
- Microsoft Lync Server 2013 : Director Troubleshooting (part 3) - Synthetic Transactions,Telnet
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro