import-module grouppolicy
# Setting file variables, local folders or UNC shares are permitted.
$path = 'C:\temp'
#$domain = Get-ADDomain
$GPOs = Get-GPO -all -server CS8ADC01
# Backup the GPOs
# Backup-Gpo -All -Path $path
# Generating HTML reports
$GPOs | ForEach-Object {
$dname = $_.DisplayName
Get-GPOReport -name ($dname) -ReportType Html -Path "C:\temp\$dname.html"}
#Get-GPOReport -name ("CPN Installer") -ReportType Html -Path "C:\temp\CPN Installer.html"