Tuesday, May 24, 2011

SCCM 2007 R2 - Create Dynamic collections based on string in computer name

Here is the query which you can use for creating Dynamic Computer Collection based on string inside the computer name.

Example: If your computers contain WKS string in computer name:

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_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SYSTEM.Name like "%WKS%" order by SMS_R_System.Name