[gptalk] Re: WMI Question

  • From: "Mills, Mark" <Mark.Mills@xxxxxxxxxxxxxxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Thu, 26 Jul 2007 14:30:30 -0500

Is there anything "wrong" or "un professional" with using the "LIKE"
command when you are filtering with WMI for just the general OS type.
Instead of having my filters look for the exact string I use the "like"
argument so it covers all versions and builds of XP or Vista.

 

I guess the caveat would be if you wanted to apply ( or not apply)
something to a specific build or service pack of an OS.

 

Examples:

 

WMI Filter looks for "Microsoft Windows XP" anywhere in the caption

SELECT * from Win32_OperatingSystem WHERE Caption LIKE "Microsoft
Windows XP%" 

 

WMI Filter looks "Vista" anywhere in the caption

SELECT * from Win32_OperatingSystem WHERE Caption LIKE "%Vista%"

Instead of looking for Vista's new caption "Microsoftr Windows VistaT
Enterprise"

 

For those looking for examples:
http://grouppolicy.editme.com/WMIFilters 

 

Mark Mills 

Other related posts: