none
Converting SCCM Query to WMI. How? RRS feed

  • Question

  • Hello - We will soon be upgrading our company to System Center Config Manager, current branch.  However until then we are using SCCM 2007 (I know, I kow...).  We are rolling out software via SCCM and AD GPO.  For the GPO, we will use a WMI query to find all installed Firefox versions less than 45.0.2.  I will also use a similar query for SCCM.  However I'm hoping one of you could interpret the below SCCM and convert it into a WMI query.  Or perhaps they are the same.  I'd really appreciate it as I know nothing about WMI scripting.  FYI, we use Win 7 Pro 64-bit PC's as well as Win 2012 Server R2.

    select distinct SMS_G_System_SYSTEM.Name, SMS_G_System_SoftwareFile.FileName, SMS_G_System_SoftwareFile.FileVersion, SMS_R_System.SystemOUName from  SMS_R_System inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where (SMS_G_System_SoftwareFile.FilePath like "%\\Program Files\\Mozilla Firefox\\" or SMS_G_System_SoftwareFile.FilePath like "%\\Program Files (x86)\\Mozilla Firefox\\") and SMS_G_System_SoftwareFile.FileVersion < "45.0.2" and SMS_G_System_SoftwareFile.FileName = "firefox.exe" order by SMS_G_System_SYSTEM.Name

    Tuesday, June 7, 2016 4:46 PM

Answers

All replies

  • For the GPO, we will use a WMI query to find all installed Firefox versions less than 45.0.2.

    Sorry but this is not a Firefox support forum. As an aside, I'm not even sure that your SCCM query is doing what you think it's doing, because "45.0.2" is a string, and you're using a comparison operator (<) on it.

    By default Firefox installs its own update service that runs in the background and keeps Firefox updated automatically. I would recommend checking into that. But again: This is not a Firefox support forum.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, June 7, 2016 4:57 PM
    Moderator
  • For the GPO, we will use a WMI query to find all installed Firefox versions less than 45.0.2.

    Sorry but this is not a Firefox support forum. As an aside, I'm not even sure that your SCCM query is doing what you think it's doing, because "45.0.2" is a string, and you're using a comparison operator (<) on it.

    By default Firefox installs its own update service that runs in the background and keeps Firefox updated automatically. I would recommend checking into that. But again: This is not a Firefox support forum.


    -- Bill Stewart [Bill_Stewart]

    Hello - I was thinking this is a WMI scripting question.  Doesn't have to be Firefox, it could be any product.  As for the above query, it is returning data that looks good to me.

    The Firefox updater is a nightmare, but we know over time it will keep on updating some PCs.  I just need to know the pc's that have less than 45.0.2

    Tuesday, June 7, 2016 5:06 PM
  • String comparisons don't work for version numbers except by accident.

    You can find out versions of applications on remote computers by reading the registry. I recommend this one (I wrote it):

    Windows IT Pro: Auditing 32-Bit and 64-Bit Applications with PowerShell

    You don't need PowerShell installed on all machines; you only need it on the machine from which you run the script.


    -- Bill Stewart [Bill_Stewart]


    Tuesday, June 7, 2016 5:08 PM
    Moderator
  • The SCCM query is a database query.  It cannot be directly converted to WMI. It is a complex multi-table query. 

    Your question is a bit vague and seems to have no objective.  Perhaps you need to learn  bit more about the technology and try asking the question again.  Remember that we do not write custom code on request.


    \_(ツ)_/

    Tuesday, June 7, 2016 5:08 PM
  • jrv is correct in that you can't "translate" a complex multi-table SCCM query into a WMI query anyway. (What would it even mean?)

    If your goal is to find out versions of applications installed on remote computers, you can use the PowerShell script l linked to, above.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, June 7, 2016 5:41 PM
    Moderator