Table of Contents

Microsoft - Active Directory - Scripting - Powershell - Group Policy

PowerShell Script to Report All Group Policy Links by Ashley McGlone.
Forensics: Audit Group Policy Links and Changes with PowerShell by Ashley McGlone.

Export list of OUs with linked GPOs

Get-ADOrganizationalUnit -Filter * | `
Get-GPInheritance | `
Where-Object {$_.GpoLinks -ne $null} | `
Select-Object Path, @{Name = 'GpoLinks';Expression = {[string]::join(', ',$_.GpoLinks.DisplayName)}} | `
Sort-Object Path | `
Export-Csv -Delimiter ";" -NoTypeInformation -Path "C:\TEMP\result.csv"