locked
WMI Filter question RRS feed

  • Question

  • I have some WMI Filter questions.

    select * from Win32_OperatingSystem Where ProductType!=2

    About the "* from Win32_OperatingSystem":  does this mean ALL OS, or just 32-bit OS? And what’s the meaning of the ProductType!=2?


    • Edited by bill gao Monday, January 23, 2017 11:59 AM
    Monday, January 23, 2017 11:58 AM

Answers

  • Hello,

    Here is the reference for Win32_OperatingSystem: https://msdn.microsoft.com/en-us/library/aa394239%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

    The Class is called Win32_OperatingSystem on both 32 bit and 64 bit OSs.

    "ProductType!=2" means that the system is not a domain controller, so, basically, you are selecting all client and server systems, except for DCs.

    /Regards

    Monday, January 23, 2017 12:58 PM
  • Hi,

    It means all OS, not only 32-bit OS. If we want to get only 64-bit OS, we may need to add the following criteria:

    and OSArchitecture = "64-bit"

    The Product Type is defined as below. So !=2 means all desktop OS and all server OS except the DC.

    ProductType 1 = Desktop OS

    ProductType 2 = Server OS – Domain Controller

    ProductType 3 = Server OS – Not a Domain Controller

    Best Regards,

    Alvin Wang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, January 23, 2017 1:26 PM

All replies

  • A better forum for scripting questions is The Official Scripting Guys forum - https://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG

    Or you simply go to TechNet and search for 'win32_operatingsystem class'.  That will find the details of that WMI class and explain all the values.


    . : | : . : | : . tim

    Monday, January 23, 2017 12:47 PM
  • Hello,

    Here is the reference for Win32_OperatingSystem: https://msdn.microsoft.com/en-us/library/aa394239%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

    The Class is called Win32_OperatingSystem on both 32 bit and 64 bit OSs.

    "ProductType!=2" means that the system is not a domain controller, so, basically, you are selecting all client and server systems, except for DCs.

    /Regards

    Monday, January 23, 2017 12:58 PM
  • Hi,

    It means all OS, not only 32-bit OS. If we want to get only 64-bit OS, we may need to add the following criteria:

    and OSArchitecture = "64-bit"

    The Product Type is defined as below. So !=2 means all desktop OS and all server OS except the DC.

    ProductType 1 = Desktop OS

    ProductType 2 = Server OS – Domain Controller

    ProductType 3 = Server OS – Not a Domain Controller

    Best Regards,

    Alvin Wang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, January 23, 2017 1:26 PM