Monday 9 September 2013

Internet Explorer Version SCCM Collection Query (WQL)

The following is an SCCM 2012 query that I use to get the IE version in my environment.  This is freely available from Microsoft and other sites, but I have slightly modified them to get exactly what I need.

SCCM Collection (Tested with 2012, SP1 CU2)

Software inventory must ben enabled and running.  Instructions found here:
http://technet.microsoft.com/en-us/library/hh509028.aspx

Change the "6.%" to "7.%", "8.%" etc. to get the different versions.

Language: WQL


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_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath like "%prog%internet%" and SMS_G_System_SoftwareFile.FileVersion like "6.%"

14 comments:

  1. how can I run this in SCCM 2012r2? Not sure where to start?

    ReplyDelete
    Replies
    1. These are device collection quieries - in the SCCM Console > Assets and Compliance > right click Device Collections > Create Device Collection. Give the Device collection a Name and (optional) comment, choose a limiting collection ( I have one I use called All Workstation or Professional Systems). Click OK then Next.

      In the Membership rules click Add Rule, select Query Rule.

      Give the Query a name and click Edit Query Statement. On the next popup window click Show Query Language (bottom left). Paste the WQL language into the Query Statement section. Overwrite what is there. Follow the prompts until complete (it's fairly straightforward)

      Delete
  2. Hi, can this run in SCCM 2007 (not R2)?

    ReplyDelete
    Replies
    1. Not sure. It is WQL so it probably will. no harm in creating a collection and attempting to use it - if it is not the correct syntax you will not get any results returned.

      Delete
  3. This works well apart from the double results due to IE 32 bit and IE 64 bit program folders on 64 bit machines. Might just need to adjust the query if you are running in a 64bit only environment which most probably are these days.

    ReplyDelete
    Replies
    1. Are you getting the computers listed twice in the collection? can you send me a screen shot of this? I would love to see it.

      Delete
    2. select DISTINCT 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_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath like "%prog%internet%" and SMS_G_System_SoftwareFile.FileVersion like "6.%"

      Delete
  4. yes, just adjust the query so it is "%program files\%internet%" and this solves the double reports.

    ReplyDelete
    Replies
    1. When I try to adjust it to that, I get a syntax error. Any ideas?

      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_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath like "%program files\%internet%" and SMS_G_System_SoftwareFile.FileVersion like "10.%"

      Delete
    2. if you use my original script, does the collection query properly?

      Delete
  5. your script works great. It saved me a ton of work.

    ReplyDelete
  6. FYI. You can return two versions or more if needed by adding an or statement. I still get the double results as well. Query language is listed below.

    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, SMS_G_System_SoftwareFile.FileVersion from SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath like "%prog%internet%" and (SMS_G_System_SoftwareFile.FileVersion like "10.%"
    or
    SMS_G_System_SoftwareFile.FileVersion like "9.%")

    ReplyDelete
  7. I want to return a column with version for all in the collection, rather than just inner join?

    ReplyDelete
  8. Great query....needed it for ie8..outstanding help

    ReplyDelete