Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell Find all Enabled Group Policy Objects

$
0
0

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'}

 


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>