GPO Modeling using Powershell

Routine User 1 Reputation point

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.

Windows Group Policy
Windows Group Policy
A feature of Windows that enables policy-based administration using Active Directory.
2,126 questions
0 comments No comments
{count} votes