======Microsoft - Active Directory - Scripting - Powershell - Group Policy====== =====Microsoft TechNet Scripting Gallery===== [[https://gallery.technet.microsoft.com/PowerShell-Script-to-eed7188a|PowerShell Script to Report All Group Policy Links]] by Ashley McGlone. \\ [[https://gallery.technet.microsoft.com/Forensics-Audit-Group-f9c57a1d|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"