Home » AD » Get all GPO in the AD forrest

Get all GPO in the AD forrest


Small PowerShell command-line to ollect all domain and GPOs names in the current AD Forrest.

# Requires RSAT installed and features enabled
Import-Module GroupPolicy
Import-Module ActiveDirectory

(get-ADForest).domains | foreach { get-GPO -all -Domain $_ | Select-Object @{n='Domain Name';e={$_.DomainName}},
 @{n='GPO Name';e={$_.DisplayName}} } | Out-File .\gpo-info.txt -Append -Force
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: