๐ Group Policy Management (PowerShell)
PowerShell commands for managing Group Policy Objects (GPOs). Useful for auditing, deployment, and automation in Active Directory environments.
๐ List All GPOs
Get-GPO -All
๐ Get GPO Details
Get-GPO -Name "Default Domain Policy"
๐ Link GPO to an OU
New-GPLink -Name "IT Policy" -Target "OU=IT,DC=example,DC=com" -LinkEnabled Yes
๐ Remove GPO Link
Remove-GPLink -Name "IT Policy" -Target "OU=IT,DC=example,DC=com"
๐พ Backup a GPO
Backup-GPO -Name "IT Policy" -Path "C:\GPOBackups"
โป๏ธ Restore a GPO
Restore-GPO -Name "IT Policy" -Path "C:\GPOBackups"
๐ฆ Import GPO Settings from Backup
Import-GPO -BackupGpoName "IT Policy" -Path "C:\GPOBackups" -TargetName "Imported IT Policy"
๐งช Test GPO Application on a Computer
gpresult /S PC-001 /USER domain\username /H report.html
๐ Force Group Policy Update Remotely
Invoke-GPUpdate -Computer "PC-001" -Force
๐ Export GPO Settings to HTML
Get-GPOReport -Name "IT Policy" -ReportType Html -Path "C:\Reports\ITPolicy.html"