From b97cf1fd9d7630bafe8cb2648537aea25e31b5bd Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Thu, 30 Jul 2020 22:04:13 +0200 Subject: [PATCH] Update --- Examples/Example-29-FindGPO0.ps1 | 52 +++++--------------------------- 1 file changed, 8 insertions(+), 44 deletions(-) diff --git a/Examples/Example-29-FindGPO0.ps1 b/Examples/Example-29-FindGPO0.ps1 index 3c46065..c17f0a9 100644 --- a/Examples/Example-29-FindGPO0.ps1 +++ b/Examples/Example-29-FindGPO0.ps1 @@ -1,47 +1,11 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force -#Invoke-GPOZaurr -OutputType Excel, Object, HTML -Open | Format-Table -#$Output = Invoke-GPOZaurr -GPOPath $Env:USERPROFILE\Desktop\GPOExport -NoTranslation #| Format-Table -#$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTestRegistryCheck' -NoTranslation -$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' -NoTranslation -Verbose -#$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExport' -NoTranslation #-OutputType HTML, Object -Open #| Format-Table -#$Output.Categories | Out-HtmlView -#$Output.Categories | Format-Table -$Output | Format-Table -#$Output.CategoriesFull | Format-Table -#$Output.Count +# Asses GPO based on exported data +$Output = Invoke-GPOZaurr -GPOPath $Env:USERPROFILE\Desktop\GPOExport -Verbose +#$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' -Verbose +$Output | Format-Table * -$Output.Reports | Format-Table -#$Output.Reports.Scripts | Format-Table * -#$Output.Reports.AccountPolicies | Format-Table * -#$Output.Reports.Audit | Format-Table * -#$Output.Reports.Autologon | Format-Table * -#$Output.Reports.EventLog | Format-Table * -#$Output.Reports.SoftwareInstallation | Format-Table * -#$Output.Reports.Policies | Format-Table * -#Output.Reports.RegistrySettings | Format-Table * -#$Output.Reports.SecurityOptions | Format-Table * -#$Output.Reports.SystemServices | Format-Table * -#$Output.Reports.SystemServicesNT | Format-Table * -#$Output.Reports.LocalUsers | Format-Table * -#$Output.Reports.LocalGroups | Format-Table * -#$Output.Reports.DriveMapping | Format-Table * -#$Output.Reports.Printers | Format-Table * -$Output.Reports.TaskScheduler | Format-Table * -return -# This is section that treats 1 GPO as single object - if there are 5 scripts in 1 GPO there's only one value - -$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' -NoTranslation -SingleObject -#$Output -#$Output.Reports | Format-Table -#$Output.Reports.Scripts | Format-Table * -#$Output.Reports.SoftwareInstallation | Format-Table * -#$Output.Reports.Policies | Format-Table * -#$Output.Reports.RegistrySettings | Format-Table * -#$Output.Reports.SecurityOptions | Format-Table * -#$Output.Reports.SystemServices | Format-Table * -#$Output.Reports.SystemServicesNT | Format-Table * -#$Output.Reports.LocalUsers | Format-Table * -#$Output.Reports.LocalGroups | Format-Table * -#$Output.Reports.DriveMapping | Format-Table * -$Output.Reports.Printers | Format-Table * \ No newline at end of file +# Export to Excel +foreach ($Key in $Output.Reports.Keys) { + $Output.Reports[$Key] | ConvertTo-Excel -FilePath $Env:USERPROFILE\Desktop\EFGPOAnalysis.xlsx -ExcelWorkSheetName $Key -AutoFilter -AutoFit -FreezeTopRowFirstColumn +} \ No newline at end of file