Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Introduction
System Center Configuration Manager (SCCM) is a powerful tool for managing and deploying software and hardware configurations in a Windows environment. One of the key features of SCCM is the ability to create collections, which are logical groups of devices that can be targeted for specific actions or deployments. Query rules are an essential part of creating collections in SCCM, allowing you to define the criteria for including devices in a collection based on various attributes. In this article, we will explore how to create SCCM collections using query rules and provide practical examples to help you get started.
Examples:
To create an SCCM collection using a query rule, you need to construct a query that specifies the criteria for including devices in the collection. The query language used in SCCM is based on Windows Management Instrumentation Query Language (WQL). Let's look at an example query that selects devices with specific software installations:
select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client
from SMS_R_System
inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId
inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64\.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%avg%"
or SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%security essentials%"
or SMS_G_System_ADD_REMOVE_PROGRAMS_64\.DisplayName like "%security essentials%"
or SMS_G_System_ADD_REMOVE_PROGRAMS_64\.DisplayName like "%avg%"
In this example, the query selects devices that have either "avg" or "security essentials" in the display name of their installed programs. The SMS_R_System
table represents the device resources, while the SMS_G_System_ADD_REMOVE_PROGRAMS
and SMS_G_System_ADD_REMOVE_PROGRAMS_64
tables represent the software installations on 32-bit and 64-bit systems, respectively.
1. Open the SCCM console and navigate to the "Assets and Compliance" workspace.
2. Expand the "Device Collections" node and right-click on the "Collections" folder.
3. Select "Create Device Collection" from the context menu.
4. In the "General" tab of the "Create Device Collection" wizard, provide a name and optional description for the collection.
5. Click on the "Next" button to proceed to the "Membership Rules" tab.
6. In the "Membership Rules" tab, click on the "Add Rule" button and select "Query Rule" from the dropdown menu.
7. In the "Query Rule Properties" dialog, provide a name and optional description for the query rule.
8. Paste the previously mentioned query into the "Query Statement" field.
9. Click on the "OK" button to save the query rule.
10. Back in the "Membership Rules" tab, click on the "Next" button to proceed to the "Summary" tab.
11. Review the summary information and click on the "Next" button to create the collection.
12. Once the collection is created, you can deploy software or perform other actions specifically targeting the devices included in the collection.
By using query rules in SCCM, you can create collections based on various criteria such as software installations, hardware configurations, or even custom attributes. This allows you to effectively target specific groups of devices for management and deployment tasks, streamlining your administrative processes.
In addition to creating collections through the SCCM console, you can also create collections programmatically or via the command line using the SCCM PowerShell module or the SCCM client command-line utility (CCMExec). These methods provide flexibility and automation options for managing collections in SCCM.
In conclusion, query rules in SCCM are a powerful tool for creating collections and targeting devices based on specific criteria. By understanding the query language and using practical examples, you can effectively leverage SCCM's capabilities to manage and deploy software and hardware configurations in your Windows environment.