Advertisement
guyrleech

Export all GPOs to a folder

Jun 19th, 2020
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [string]$folder = 'C:\@guyrleech\GPOs'; Import-Module GroupPolicy; if( ! ( Test-Path -Path $folder )) { $null = New-Item -Path $folder -ItemType Directory -Force}; Backup-GPO -All -Path $folder -Comment "Backed up by $env:username from $env:COMPUTERNAME at $(Get-Date -Format G)" | Export-csv -Path (Join-Path -Path $folder -ChildPath GPO.backup.details.csv) -NoTypeInformation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement