1. Create a new filter: $filter = new-item -path "VCRoot:\" -Name "Testfilter" -Queries @( "root\cimv2;select * from Win32_Bios" ) -ItemType WMIFilter
2. (optional) Check in the filter: $filter = $filter | select-checkin
3. Deploy the filter: $filter = $filter | select-deploy The filter remains in the checked in (available) state, although the object history in the GUI says "deployed".
Deployment through the GUI works, and deployment for GPOs in powershell also works.
When you do a deploy in the GUI, if you then look at Show History and select Events - Show All Events
You'll see that a deploy actually does a Request Approval, then a Approve, before the Deploy is Completed
a Deploy from Powershell, doesnt show the Request Approval, then a Approve
In order to deploy a WMI Filter, you need to add the following
$filter = $filter | Select-RequestApproval | Select-Approve | Select-Deploy
this then works and when you do the $fliter, the Version is increased and in the History its all correct
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center