GPO Modeling using Powershell

Routine User 6 Reputation points

Am using powershell to do GPO Modeling.

$gpmObject = New-Object -ComObject GPMgmt.GPM;  
$gpmDomain = $gpmObject.GetDomain('', '', 0);  
$gpmConstants = $gpmObject.GetConstants();  
$rsopObject = $gpmObject.GetRSOP($gpmConstants.RSOPmodePlanning,$null,0);  
$rsopObject.PlanningDomainController ='';  
$rsopObject.PlanningComputer ='domain\compName$';  
$rsopObject.PlanningUser = 'domain\Administrator';  
$rsopObject.planningComputerSOM = 'OU=Domain Controllers,DC=domain,DC=com';  
$rsopObject.planningUserSOM = 'CN=Users,DC=lyncforb,DC=local';  
$rsopObject.PlanningFlags=8;	//means setting only RSOP_PLANNING_ASSUME_USER_WQLFILTER_TRUE  

Here I want only one WMI Filter to be true when simulating GPO Modeling.

But seems $rsopObject.PlanningComputerWMIFilters is not taken into account at all, and all WMI filters associated with GPOs are evaluated as false.

If I set RSOP_PLANNING_ASSUME_COMP_WQLFILTER_TRUE and also use $rsopObject.PlanningComputerWMIFilters, all WMI Filters are considered as true in the result html (again without considering WMI filters specified in $rsopObject.PlanningComputerWMIFilters).

How to make $rsopObject.PlanningComputerWMIFilters relevant and I only want WMI filters specified there only to be evaluated as true.

A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,069 questions
0 comments No comments
{count} votes