PowerTip: Use PowerShell Find all Enabled Group Policy Objects

Doctor Scripto

Summary: Use a Windows PowerShell cmdlet to find all enabled Group Policy objects in an Active Directory domain.

Hey, Scripting Guy! Question How can I easily find all enabled Group Policy objects in an Active Directory domain?

Hey, Scripting Guy! Answer Use the Get-Gpo cmdlet, specify the domain, and use the –all switch. Pipe the resulting objects to the Where-Object and look for a status that matches enabled. Note that ? is the alias for Where-Object.

The following is Windows PowerShell 3.0 syntax:

get-gpo -Domain iammred.net -all | ? gpostatus -match ‘enabled’

The following is Windows PowerShell 2.0 syntax:

get-gpo -Domain iammred.net -all | ? { $_.gpostatus -match ‘enabled’}

 

0 comments

Discussion is closed.

Feedback usabilla icon