Menu
CCMEXEC.COM – Enterprise Mobility
  • General
  • Configuration Manager
  • Windows 10
  • Windows 11
  • Intune
  • GitHub
  • About
CCMEXEC.COM – Enterprise Mobility

Query to determine 32 or 64 bit Operating System

Posted on July 1, 2011 by Jörgen Nilsson

In many cases there are a need create a collection with either all Windows 7 – x86 or all Windows 7 x64 installed. This can be used for targeting only a specific platform with an update or a program.
I do this by querying the SCCM inventory, SMS_G_System_COMPUTER_SYSTEM.SystemType which returns “x64-based PC”or “X86-based PC”.

Query to find all Windows 7 – x64

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 inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC" and SMS_G_System_OPERATING_SYSTEM.Caption like "Microsoft Windows 7%"

And the query for Windows 7 -x86

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 inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.SystemType = "X86-based PC" and SMS_G_System_OPERATING_SYSTEM.Caption like "Microsoft Windows 7%"

13 thoughts on “Query to determine 32 or 64 bit Operating System”

  1. Gigs says:
    January 18, 2012 at 9:34 pm

    Thanks! You do great work and I appreciate you sharing with the rest of us.

    Reply
  2. Kingsley says:
    July 19, 2012 at 2:34 am

    Thanks!

    Reply
  3. Valentin says:
    September 10, 2012 at 7:43 pm

    This is not working in configmgr 2012. Is there anything else that needs to be added?
    Thanks

    Reply
  4. Siddhesh says:
    November 8, 2012 at 4:06 am

    Thanks a lot, very usefull.

    Reply
  5. Chad Simmons says:
    January 21, 2013 at 9:24 pm

    This T-SQL query works on my SCCCM 2012 RTM production environment.
    Also, this one doesn’t use SMS_G_System_OPERATING_SYSTEM.

    select S.ResourceID,S.ResourceType,S.Name0,S.Operating_System_Name_and0,
    S.SMS_Unique_Identifier0,S.Resource_Domain_OR_Workgr0,S.Client0, CS.SystemType0
    from v_R_System as S
    inner join v_GS_COMPUTER_SYSTEM as CS on CS.ResourceID = S.ResourceID
    where S.Operating_System_Name_and0 = ‘Microsoft Windows NT Workstation 6.1’
    and CS.SystemType0 = ‘x64-based PC’
    –and CS.SystemType0 = ‘X86-based PC’

    Reply
  6. Alex says:
    March 5, 2013 at 8:04 pm

    Is this report determining if the hardware is x64 or x86 or if the OS architecture installed is x64 or x86? I need a way to determine which OS installed on a x64 capable machine.

    Reply
    1. Jörgen Nilsson says:
      March 5, 2013 at 8:16 pm

      Hi,
      It determines if the OS is x86 or x64 based.
      /Jörgen

      Reply
  7. gabe says:
    March 14, 2013 at 10:10 pm

    The problem with this Query is that it seems to only show systems with the SCCM client installed.

    Reply
  8. LvilleSystemsJockey says:
    July 10, 2013 at 9:39 pm

    Why not use the simple value >> Operating System – OS Architecture? I know it isn’t on by default, but you can turn it on in hardware inventory. I have read several posts that say what is shown above pulls hardware capable info, not the OS running on top of it. Anyone else see similar results?

    LvilleSystemsJockey

    Reply
  9. ersatyle says:
    November 4, 2013 at 9:13 pm

    it does work on the running OS, as stated;) If I have a 32 bits Windows 7 installed on a 64 capable computer, it will show up in the SMS_G_System_COMPUTER_SYSTEM.SystemType = “X86-based PC” collection, and not in the “x64-based PC”

    Reply
  10. Uniho Hanashi says:
    June 9, 2015 at 7:33 am

    you check it in DXDIAG as well or just check if your PC is using all your RAM.

    Reply
  11. Salman Aslam says:
    February 23, 2016 at 11:47 am

    Hi Jorgen, I’m being following your SCCM documentations from a long time and it’s a really helpful materiel. At the moment, i’m stuck to generate a collection of x64 bit & x32 bit os architecture report in my SCCM environment. In fact, i’m having a very basic knowledge of SCCM collection. Also note, we have deployed SCCM with all features & reporting functionality from local vendor. Could you please help me out the process how to run the query or collection to generate the report as stated above. Thanks.

    Reply
  12. Martin Gownes says:
    May 23, 2019 at 2:30 pm

    Many thanks!

    Reply

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

My name is Jörgen Nilsson and I work as a Senior Consultant at Onevinn in Malmö, Sweden. This is my blog where I will share tips and stuff for my own and everyone elses use on Enterprise Mobility and Windows related topics.
All code is provided "AS-IS" with no warranties.

Recent Posts

  • MMUGSE – Meetup October 24 2026
  • Windows 365 Link – a week and some
  • Prevent software installations disguised as drivers
  • Tip when troubleshooting unexpected reboots during Autopilot – event ID 2800
  • New settings in Intune Security Baseline Windows 11 24H2 -2504
©2025 CCMEXEC.COM – Enterprise Mobility | WordPress Theme by Superb Themes
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT