This was originally posted on my old blog in August 2014, but I wanted to dust it off, give it a rub down and see if it still works inside of SQL Server 2014 against System Center Configuration Manager 1606.  It does!  Yay!  Okay, not that great really, since it’s dealing with the same underlying data sets.  Anyhow, here it is…

The code

-- Remember to change the the database name on the next line!!!
USE CM_PS1
GO

SELECT DISTINCT 
  a.netbios_name0 COMPUTER_NAME, 
  CASE 
    WHEN PATINDEX('%.%',b.fileversion) = 3 THEN 
      SUBSTRING(b.fileversion,1,2) 
    WHEN PATINDEX('%.%',b.fileversion) = 2 THEN 
      SUBSTRING(b.fileversion,1,1) 
    ELSE SUBSTRING(b.fileversion,1,1) 
  END AS IEX 
FROM 
  dbo.v_R_System a LEFT OUTER JOIN 
  dbo.v_GS_SoftwareFile b ON a.ResourceID=b.ResourceID 
WHERE 
  filename LIKE 'iexplore.exe' AND Active0=1
  AND 
  LTRIM(fileversion) <> ''
ORDER BY COMPUTER_NAME

The output

sql_cm_ieversions.PNG

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s