Dynamic groups based on file version or installed update?
-
Wednesday, September 07, 2011 9:52 AM
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
All Replies
-
Friday, September 09, 2011 9:08 AMModerator
Hello Sewellia,
There is a three step process to create a dynamic group:
- Create an attribute to trigger membership of the group
- Define a managed group based on the value of the attribute
- 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.aspxAnd 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.aspxThanks,
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 LiMicrosoft Contingent Staff, Moderator Wednesday, September 21, 2011 10:32 AM
-
Friday, September 09, 2011 9:14 AM
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
-
Monday, September 19, 2011 11:07 AMModerator
Hi,
If you are talking about this article,
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 LiMicrosoft Contingent Staff, Moderator Wednesday, September 21, 2011 10:32 AM
-
Thursday, September 22, 2011 7:41 PM
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?
-
Monday, September 26, 2011 5:48 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 7:46 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 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
-
Monday, September 26, 2011 8:17 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

