One thing that comes to my mind immediately is the misspelling of "Microsoft" in your query. There is an "r" at the end which should not be there...
Hi!
I am trying to create a WMI Filter for a GPO so that it only will apply to Windows Vista Business. This GPO does only one thing and that is to run a login script. The script is very simple and is designed to change the power settings from Power Saver to High Performance.
Using Scriptomatic I came up with the following filter:
[code:1]SELECT * FROM Win32_OperatingSystem WHERE Caption = 'Microsoftr Windows VistaT Business' [/code]
I have tried with double quotes as well, but to no avail. I have also tried using BuildNumber = '6001' and that doesn't seem to work.
I have essentially the same setup for Windows XP and it is working fine. The script works as expected if I run it from the desktop, but not when I try from a login script. Here are the contents of the script:
[code:1]strComputer="."
shellCommand1="POWERCFG -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
Set oShell=CreateObject("Wscript.Shell"& #41;
oShell.run "%comspec% /c " & shellCommand1[/code]
As you can see it is a very simple script and works fine.
I ran the filter on the WMI Filter Validator from GPOGuy and got this error: “Call was canceled by the message filter. (Exception from HRESULT:0x80010002 (RPC_E_CALL_CANCELED))"
Can anyone see the reason this WMI filter is not working? Thanks!
One thing that comes to my mind immediately is the misspelling of "Microsoft" in your query. There is an "r" at the end which should not be there...
I used the following script to get the caption of the OS.
[code:1]On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "Caption: " & objItem.Caption
Next[/code]
This is why there is also a T at the end of Vista. As far as I can tell the r is for Registered (R) and the T is for TradeMark (TM).
Mmh, when I execute your query, I do not see the "R" at the end of "Vista", but the "®".
I am not sure if this is the problem you are facing, but to overcome this possible issue I tried this query:
[code:1]Select * FROM Win32_OperatingSystem WHERE caption like '%Vista%Business%'[/code]
This query works fine for me in a simple vb script and with the validate tool you mentioned I do no get an error.
Does this work for you as well?
Interesting....
When I copy your filter, it still does not work. I get the same error :x