SCCM Create Collections for Laptops

Last Updated

November 15, 2017

Posted In

SCCM Create Collections for Laptops In Configuration Manager a query is a specific set of instructions that extract information about a defined set of objects. You can create queries and store them in the Configuration Manager 2012 site database. By running a query, you search the database for information about the objects that match the query criteria. Configuration Manager comes with just a handful of queries out-of-the-box that illustrates a small part of the rich amount of data available. If you ever wanted to create a SCCM collection for all the laptops in your organization you could use the below query to do it.

Query_image

SCCM Create Collections for Laptops

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_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where
SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ( “8”, “9”, “10”, “14” )

 

Install and Update Third Party Applications with Patch My PC
Install and Update Third Party Applications with Patch My PC

 

If you want to change the system enclosure type, here is Microsoft’s list of chassis type codes:

1 Other
2 Unknown
3 Desktop
4 Low Profile Desktop
5 Pizza Box
6 Mini Tower
7 Tower
8 Portable
9 Laptop
10 Notebook
11 Hand Held
12 Docking Station
13 All in One
14 Sub Notebook
15 Space-Saving
16 Lunch Box
17 Main System Chassis
18 Expansion Chassis
19 Sub Chassis
20 Bus Expansion Chassis
21 Peripheral Chassis
22 Storage Chassis
23 Rack Mount Chassis
24 Sealed-Case PC

Leave a Reply

Your email address will not be published. Required fields are marked *

11 Comments

  1. After Ctrl+V, delete ” and retype ” manually on keybord

  2. ( “8”, “9”, “10”, “14” ) this not work
    I use like this (8, 9, 10, 14)

    Thanks

  3. Avatar photo Brittany Paige says:

    There is an error in the script, INSTEAD, USE SINGLE QUOTES:

    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_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where
    SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ( ‘8’, ‘9’, ’10’, ’14’ )

  4. Hi

    There are now some new types:

    30 – Tablet
    31 – Convertible
    32 – Detachable

  5. Avatar photo Julian Ontiveros says:

    The issue is in the quotation marks around the numbers ( “8”, “9”, “10”, “14” ). Somehow copy/pasting this script from this website inserts symbols that LOOK like quotation marks, but they aren’t. Delete and re-type each quotation mark and you will fix the problem.

    See my attached screenshot. The difference is slight, but it’s there. I replaced the quotation marks on “10” and “14”, but I left the original quotation marks for “8” and “9”. https://uploads.disquscdn.com/images/47024a837d79b490430081f904bec6ef30c1b8e9d475de08362e149a82214f09.png

    1. Thanks Julian and Prajwal.

  6. Avatar photo FlavioPena says:

    Hi Prajwal, thanks for providing the sql query to create the collection. However, when I try to create a device collection based on your query, I recieve the following error “This query has a syntax error. Are you sure you want to save it?”
    I went through query statement, but couldn’t find any syntax error. Just wondering if anyone else has received this error message as well?
    Thanks for your help. https://uploads.disquscdn.com/images/48199bd803c268ec4996db01cb93e684fd154f4d847c50ddff43e3dcd79a7a62.png

    1. Avatar photo Rajasekhar says:

      i am also getting the same error. verified the query but no use. Prajwal please advice.

    2. Avatar photo Julian Ontiveros says:

      I replied to @disqus_Kztq7PdjPu:disqus with the solution

    3. Avatar photo Anil Bhatt says:

      Hi all I am New in SCCM, same has not working advise please

Prajwal Desai

Prajwal Desai is a highly accomplished technology expert and an 11-time Dual Microsoft MVP (Most Valuable Professional), specializing in Microsoft Intune, SCCM, Windows 365, Enterprise Mobility, and Windows. As a renowned author, speaker, and community leader, he is widely recognized for sharing his in-depth expertise and insights through his blog, YouTube channel, conferences, webinars, and other platforms.