From 3b04efcbc8b78ffdfff7d008d1a798d94b6c8979 Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Sat, 24 Aug 2024 11:01:02 +0200 Subject: [PATCH] Commit examples --- Examples/Example-04-GPOInformation02.ps1 | 2 +- Examples/Example-29-FindGPO2.ps1 | 11 ++++++- Examples/Example-40-ShowGPO01.ps1 | 37 +++++++++++++++--------- Examples/Example-49.ps1 | 16 ++++++++++ Examples/Example-56-AnalyseGPOs.ps1 | 5 +--- Examples/Example-58-DuplicateCNF.ps1 | 4 +++ 6 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 Examples/Example-49.ps1 create mode 100644 Examples/Example-58-DuplicateCNF.ps1 diff --git a/Examples/Example-04-GPOInformation02.ps1 b/Examples/Example-04-GPOInformation02.ps1 index 8fe2d82..b5617c3 100644 --- a/Examples/Example-04-GPOInformation02.ps1 +++ b/Examples/Example-04-GPOInformation02.ps1 @@ -3,5 +3,5 @@ #$GPOS = Get-GPOZaurr -GPOName 'TEST | Office Configuration' #$GPOS | Format-Table -AutoSize * -$GPOS = Get-GPOZaurr -GPOName 'New Group Policy Object3' +$GPOS = Get-GPOZaurr -GPOName 'TEST | EmptyWITHGPF' $GPOS | Format-Table -AutoSize * \ No newline at end of file diff --git a/Examples/Example-29-FindGPO2.ps1 b/Examples/Example-29-FindGPO2.ps1 index 563541f..1856855 100644 --- a/Examples/Example-29-FindGPO2.ps1 +++ b/Examples/Example-29-FindGPO2.ps1 @@ -2,7 +2,16 @@ # This gets the same thing as earlier examples # with a difference where one entry per gpo and all settings for that GPO is stored under settings property. -$Output = Invoke-GPOZaurrContent -Verbose #-SingleObject -Verbose +#$Output = Invoke-GPOZaurrContent -Verbose #-SingleObject -Verbose +#$Output | Format-Table + + +$Output = Invoke-GPOZaurrContent -Verbose -GPOName 'Default Domain Policy' $Output | Format-Table + +Invoke-GPOZaurr -Type GPOAnalysis -GPOName 'Default Domain Policy' -Verbose + + +return $Output.Reports.RegistrySettings | Format-Table * $Output.Reports.RegistrySettings[0].Settings | Format-Table * \ No newline at end of file diff --git a/Examples/Example-40-ShowGPO01.ps1 b/Examples/Example-40-ShowGPO01.ps1 index fd858cc..c3d7dcf 100644 --- a/Examples/Example-40-ShowGPO01.ps1 +++ b/Examples/Example-40-ShowGPO01.ps1 @@ -1,19 +1,30 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force -Invoke-GPOZaurr -Type GPOOrganizationalUnit -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html +# # Shows how to use exclusions for GPOList (different way) +# Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOList -Online -Exclusions { +# Skip-GroupPolicy -Name 'de14_usr_std' +# Skip-GroupPolicy -Name 'ALL | Enable RDP' -DomaiName 'ad.evotec.xyz' +# '01446204-d2b5-4c9a-a539-5d0f64f27fbc' +# '{01cef2e1-ea5c-4c4a-bd43-94d89d8a7810}' +# } -# Shows how to use exclusions (supported only in GPOBlockedInheritance) -Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOBlockedInheritance -Online -Exclusions @( - 'OU=Test,OU=ITR02,DC=ad,DC=evotec,DC=xyz' -) +# Invoke-GPOZaurr -Type GPOOrganizationalUnit -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html -# different approach to query multiple reports or just one -Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -PassThru -Type GPOConsistency, GPOList, GPODuplicates, GPOBroken, GPOOwners, NetLogonOwners, GPOPermissionsRead, GPOPermissionsAdministrative,GPOPermissionsUnknown +# # Shows how to use exclusions (supported only in GPOBlockedInheritance) +# Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOBlockedInheritance -Online -Exclusions @( +# 'OU=Test,OU=ITR02,DC=ad,DC=evotec,DC=xyz' +# ) -Invoke-GPOZaurr -Type GPOOwners -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html +# # different approach to query multiple reports or just one +# Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -PassThru -Type GPOConsistency, GPOList, GPODuplicates, GPOBroken, GPOOwners, NetLogonOwners, GPOPermissionsRead, GPOPermissionsAdministrative, GPOPermissionsUnknown -# Shows how to use exclusions for GPOList (different way) -Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOList -Online -Exclusions { - Skip-GroupPolicy -Name 'de14_usr_std' - Skip-GroupPolicy -Name 'ALL | Enable RDP' -DomaiName 'ad.evotec.xyz' -} \ No newline at end of file +#Invoke-GPOZaurr -Type GPOOwners,GPOConsistency -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html + +#Invoke-GPOZaurr -Type GPOOwners -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html + +##Invoke-GPOZaurr -Type GPOOwners,GPOConsistency -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html -SplitReports +#invoke-gpozaurr -Type GPOOrganizationalUnit +#Invoke-GPOZaurr -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOAnalysis #-SplitReports -Forest test.evotec.pl + + +Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOBlockedInheritance -Forest 'ad.evotec.xyz' \ No newline at end of file diff --git a/Examples/Example-49.ps1 b/Examples/Example-49.ps1 new file mode 100644 index 0000000..0833c11 --- /dev/null +++ b/Examples/Example-49.ps1 @@ -0,0 +1,16 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +#Save-GPOZaurrFiles -GPOPath $Env:USERPROFILE\Desktop\TestF + +#Get-GPOZaurr -GPOPath "$Env:USERPROFILE\Desktop\TestF" | Sort-Object -Property DisplayName | Where-Object { $_.EMpty -eq $true } | Format-Table * + + + +return +$GPO = Get-GPOZaurr -GPOName 'ALL | Allow use of biometrics' +$GPO | Format-List * + +#$GPO.Count +#$GPO | Where-Object { $_.Empty -eq $true } | Format-Table * +#($GPO | Where-Object { $_.Empty -eq $true }).Count +#$GPO | Where-Object { $_.DisplayName -like "*TEST*" } | Format-Table * \ No newline at end of file diff --git a/Examples/Example-56-AnalyseGPOs.ps1 b/Examples/Example-56-AnalyseGPOs.ps1 index e8e8ccf..f152053 100644 --- a/Examples/Example-56-AnalyseGPOs.ps1 +++ b/Examples/Example-56-AnalyseGPOs.ps1 @@ -3,12 +3,9 @@ $Output = Invoke-GPOZaurrContent -Verbose -GPOName 'Default Domain Policy' $Output | Format-Table -<# # You need PSWriteOffice for that foreach ($Key in $Output.Keys) { $Output[$Key] | Export-OfficeExcel -FilePath $Env:USERPROFILE\Desktop\GPOAnalysis.xlsx -WorkSheetName $Key } -Invoke-GPOZaurr -Type GPOAnalysis -GPOName 'ALL | Allow use of biometrics', 'ALL | Enable RDP' -GPOGUID '{31B2F340-016D-11D2-945F-00C04FB984F9}' -IncludeDomains 'ad.evotec.xyz' -Verbose - -#> \ No newline at end of file +Invoke-GPOZaurr -Type GPOAnalysis -GPOName 'ALL | Allow use of biometrics', 'ALL | Enable RDP' -GPOGUID '{31B2F340-016D-11D2-945F-00C04FB984F9}' -IncludeDomains 'ad.evotec.xyz' -Verbose \ No newline at end of file diff --git a/Examples/Example-58-DuplicateCNF.ps1 b/Examples/Example-58-DuplicateCNF.ps1 new file mode 100644 index 0000000..873f987 --- /dev/null +++ b/Examples/Example-58-DuplicateCNF.ps1 @@ -0,0 +1,4 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +Get-GPOZaurrDuplicateObject -Verbose +