SCCM Collection QueriesUPDATE: 25th May 2014
If you click the SQL button on the menu above, you will find our entire collection of queries.
We have been building a number of collections within SCCM lately so we thought we would start to build up a reference here of various collections, some simple, some more complex. We will be adding to this when we can so make sure you come back and check for updates.
Computers with certain prefixes - % being a wildcard
select SMS_R_System.NetbiosName
from
SMS_R_System
WHERE
SMS_R_System.NetbiosName = "ABC%"
Adobe Reader XI Installations - from Programs in Control Panel
select SMS_R_System.NetbiosName,
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName from
SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on
SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId =
SMS_R_System.ResourceId where
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like “Adobe Reader XI”
Devices based on OU
select distinct * from SMS_R_System
WHERE
SMS_R_System.SystemOUName = "OU NAME"
Windows 8 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_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId
WHERE
SMS_R_System.OperatingSystemNameandVersion
LIKE
"%Workstation 6.2%" or SMS_R_System.OperatingSystemNameandVersion LIKE "%Windows 8%"
COMMENTS / REQUESTS
If you have any comments or requests for new queries or if you would like to add your own query to our site, then please feel free to leave a comment or contact us by clicking the Contact button on the top main menu bar.Labels: Guide, SCCM, SQL