Get the WMI queries used in a Group Policy object with PowerShell
You can easily read the Group Policy objects in a domain using PowerShell *(if the Group Policy Management Console feature is installed).
Each Group Policy object can have a WMI filter assigned to them which are actually stored as separate objects.
You can read the WMI filter setting using PowerShell with the following commands
$gpo = Get-GPO "Default Domain Policy";
$gpo.WmiFilter|SELECT *
However this doesn't show the actual WMI queries
$gpo = Get-GPO "Default Domain Policy";
$gpo.WmiFilter.GetQueryList();
The WmiFilter object is actually a .NET type Microsoft.GroupPolicy.WmiFilter - the methods of which are documented here.
Comments
Post a Comment