Microsoft KB Archive/200972

= SMS: Custom Collection Examples =

Article ID: 200972

Article Last Modified on 2/27/2007

-

APPLIES TO


 * Microsoft Systems Management Server 2003
 * Microsoft Systems Management Server 2.0 Standard Edition

-



This article was previously published under Q200972



SUMMARY
In Microsoft Systems Management Server, you can build collections based on the resource class. This article describes how to create two sample queries to:
 * Find domain controllers
 * Find all computers in a particular subnet



Steps to Create a Query to Find All Domain Controllers at a Site
NOTE: This procedure assumes the domain controller is a client and hardware inventory is turned on.  In the SMS Administrator console, right-click Queries, point to New, and click Query on the shortcut menu. Type TEST1 for the Name. In the Object Type box, enter System Resource if it is not already entered. Click Edit Query Statement, then click the icon with the yellow rays. Click the Select button on the Result Properties page. Select Computer System in the Attribute class box and select Name in the Attribute box. Then click OK. On the Result Properties page, select Ascending in the Sort box. Click OK.</li> Click the icon with the yellow rays. Repeat steps 5 through 7 but replace Name with Roles in the Attribute box (step 6) and replace Ascending with Unsorted in the Sort box (step 7).</li> Select the Criteria tab under TEST1 Query Statement Properties. Click the icon with the yellow rays. On the Criterion Properties page, enter the following: <ul> Criterion Type: simple value</li> Where: Choose Select... <ul> Attribute class: Computer System</li> Attribute: Roles</li></ul> </li> Operator: is like</li> Value: %Domain_Controller%</li></ul>

Click OK.

</li> Click OK. On the Query Properties page, limit the collection to All Windows NT Server Systems.</li> Click OK to save the query.</li></ol>

Steps to Create a Query to Find All Computers in a Subnet
<ol> In the SMS Administrator console, right-click the Queries node, point to New, and click Query on the shortcut menu.</li> Type TEST2 in the Name box.</li> In the Object Type box, enter System Resource if it is not already entered.</li> Click Edit Query Statement and then click the icon with the yellow rays.</li> On the Result Properties page, click the Select button.</li> <li>Select System Resource in the Attribute class box and select Name in the Attribute box. Then click OK.</li> <li>On the Result Properties page, select Ascending in the Sort box. Click OK.</li> <li>Click the icon with the yellow rays. Repeat steps 5 through 7 but replace Name with IP Addresses in the Attribute box (step 6) and replace Ascending with Unsorted in the Sort box (step 7).</li> <li>Repeat step 8 but replace Name with IP Subnets.</li> <li>Select the Criteria tab under TEST2 Query Statement Properties. Click the icon with the yellow rays. On the Criterion Properties page, select the following: <ul> <li>Criterion Type: simple value</li> <li>Where: Choose Select... <ul> <li>Attribute class: System Resources</li> <li>Attribute: IP Subnets</li></ul> </li> <li>Operator: is equal to</li> <li>Value: click the Value button and select the subnet you want.</li></ul>

Click OK

</li> <li>Click OK. On the TEST2 Query Properties page, select Not Collection Limited (or choose a selection that will further limit the search, such as Win98 on subnet x).</li> <li>Click OK to save the query.</li></ol>

Collections can be created based on the queries noted earlier: Collections/New <enter name>/Membership Rules/Query Rule properties/Name (TEST1 or TEST2 in the example above).

Additional query words: prodsms sms20 Query Collections smsui

Keywords: kbcollections kbinfo kbquery KB200972

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.