We help IT Professionals succeed at work.
Get Started

GPO WMI Filtering On Machine Vendor

Staskiewicz asked
Last Modified: 2012-05-10
I am trying to create a GPO filter to target to a specific vendor of our fleet of systems.  I've located what I think is the location in WMI, but I can't seem to get the select, from, where statement right to target it.  Any help would be much appreciated. I've attached the script I used with scriptomatic and the output of it.

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("MachineName")
For Each strComputer In arrComputers

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo "Vendor: " & objItem.Vendor
      WScript.Echo "Version: " & objItem.Version

Open in new window

Name: CF-30FCS72AM
Vendor: Matsushita Electric Industrial Co.,Ltd.
Version: 002

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE