Cleaning up unlinked Group Policy objects in Active Directory with Powershell
Just a quick script below to run through all unlinked GPO’s in a domain, back them up, export a report and then remove them. Sweet and short but useful. (# Comment the remove line if you don’t want to remove any) Import-Module GroupPolicy $backupPath="C:\Users\jeffrl-p\Desktop\Backup_GPO" if (-Not(Test-Path -Path $backupPath)) { mkdir $backupPath } Get-GPO -All | Sort-Object d...
Just a quick script below to run through all unlinked GPO’s in a domain, back them up, export a report and then remove them. Sweet and short but useful. (# Comment the remove line if you don’t want to remove any) Import-Module GroupPolicy $backupPath="C:\Users\jeffrl-p\Desktop\Backup_GPO&q...