wmi group policy filter

  • Thread starter Thread starter Kim Oppalfens
  • Start date Start date
K

Kim Oppalfens

Hi all,

Anyone have an idea how to create a wmi filter that applies to a gpo,
that makes sure that the gpo only applies to computers that do NOT have a
certain service installed?
 
Well the script would look like below, but I am unsure as to where/how to
apply one of these "WMI Policy Filters"

set svc = getobject("winmgmts:root\cimv2")
set objEnum = svc.execQuery("select __relpath From win32_service where name
= 'ServiceName' and state = 'running'"
for each obj in objEnum
wscript.echo " Found the service in a running state"
next

Hope that helps.
 
Back
Top