none
Dynamic groups based on file version or installed update?

    Question

  • Hi

    I want to create a dynamic goup based on the version of a file (wuapi.dll). Is there a way to do this? Cant see that a registry probe solves the problem.

    Or are there other ways to check if KB2607070 has been installed?

    Thanks


    • Edited by sewellia Wednesday, September 07, 2011 9:52 AM
    Wednesday, September 07, 2011 9:52 AM

Answers

All replies

  • Hello Sewellia,

    There is a three step process to create a dynamic group:

    1. Create an attribute to trigger membership of the group
    2. Define a managed group based on the value of the attribute
    3. Create a Computer group linked to the managed group

    The first step is to create an attribute that we can use to evaluate whether a computer has a piece of software installed or not. This can be based on either a registry key or WMI query.

    In your scenario, you must write your own WMI query to get the version of the specific file. The following article will show you an example:

    How Can I Determine the Version Number of a File?
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/04/18/how-can-i-determine-the-version-number-of-a-file.aspx

    And then, follow this article to finish the other steps:

    Creating a Dynamic Group Based on Installed Software
    http://blogs.technet.com/b/systemcenteressentials/archive/2010/05/12/creating-a-dynamic-group-based-on-installed-software.aspx

    Thanks,


    Yog Li -- Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by sewellia Friday, September 09, 2011 9:13 AM
    • Unmarked as answer by sewellia Friday, September 09, 2011 9:50 AM
    • Marked as answer by Yog LiModerator Wednesday, September 21, 2011 10:32 AM
    Friday, September 09, 2011 9:08 AM
    Moderator
  • Thanks. That was precisely what I was looking for.
    I found the correct WMI queries, but what to enter for "WMI Namespace" and "property name" when creating this attribute?

    thanks!!!

    • Edited by sewellia Friday, September 09, 2011 10:07 AM
    Friday, September 09, 2011 9:14 AM
  • Hi,

    If you are talking about this article,

    http://blogs.technet.com/b/heyscriptingguy/archive/2005/04/18/how-can-i-determine-the-version-number-of-a-file.aspx

     

    then Namespace is CIMv2 and property is 'Version' http://msdn.microsoft.com/en-us/library/aa387236(v=VS.85).aspx

     


    Ketan Thakkar | Microsoft Online Community Support
    • Marked as answer by Yog LiModerator Wednesday, September 21, 2011 10:32 AM
    Monday, September 19, 2011 11:07 AM
    Moderator
  • Thanks again Ketan

    I use for the WMI attribute (I named it "WUAPI.DLL file version") configuration

    namespace: CIMv2

    query: Select * from CIM_Datafile Where Name = 'c:\\windows\\system32\\wuapi.dll'

    property name: Version

     

    but the group  inclusion rule: ( Object is Windows Computer_Extended AND ( WUAPI.DLL file version Equals 7.6.7600.243 ) AND True ) 

    does not return any computers.

    Do you see anything wrong?

     

     

     

    Thursday, September 22, 2011 7:41 PM
  • I am not sure if the actual query for version is something doable. I used this link as a reference

    http://msdn.microsoft.com/en-us/library/Aa387236

     then I tried this query and it looks like the version may not be populated as a criteria for the group as WMI is unable to get the Version of the file

    Select version from CIM_Datafile Where Name = 'c:\\windows\\system32\\wuapi.dll'

    I got as a result CIM_DataFile=<nokey> 

    So as far as I can tell, this is something that WMI is unable to capture for us. If you still have questions about this, I would recommend post this question with this query I've mentioned above in a WMI forum where you may be able to get more insight about the query. If they provide you a better query, then that query will be the one to be used here.

     

    Please let us know if you have any question.

     

    Thanks!

    Jose.

    Monday, September 26, 2011 5:48 PM
  • That I do not understand. When I run the exact same query in a script, the correct version is reported. 

    Has no one actually tried (I mean succeeded) to create a SCE dynamic group based on the properties of a file?  

    I am not a programmer and would very much like to have a working example to set out from...

     

     

     

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set colFiles = objWMIService.ExecQuery _

        ("Select Version from CIM_Datafile Where Name = 'c:\\windows\\system32\\wuapi.dll'")

    For Each objFile in colFiles

        Wscript.Echo objFile.Version

    Next

     

     

     

    Monday, September 26, 2011 7:46 PM
  • Sewellia,

    were you able to get the version of the files by running the query in wbemtest? if so, please send me the repro steps so I can try it.

     

    Thanks

    Monday, September 26, 2011 8:05 PM
  • Sewellia,

    were you able to get the version of the files by running the query in wbemtest? if so, please send me the repro steps so I can try it.

     

    Thanks

    Hi Jose

    No, I ran this script as vbs 

    jos

    Monday, September 26, 2011 8:17 PM