diff --git a/Examples/Example-08-ListingPermissionsPerGPO.ps1 b/Examples/Example-08-ListingPermissionsPerGPO.ps1 index c6c69ce..f0f9d54 100644 --- a/Examples/Example-08-ListingPermissionsPerGPO.ps1 +++ b/Examples/Example-08-ListingPermissionsPerGPO.ps1 @@ -1,4 +1,12 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force -$T = Get-GPOZaurrPermission -GPOName 'ALL | Enable RDP' #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +$T = Get-GPOZaurrPermission -GPOName 'Default DOmain Policy' #-Principal 'marikegerard' -PrincipalType Name # #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +$T | Format-Table -AutoSize * +$T = Get-GPOZaurrPermission -GPOName 'Default DOmain Policy' -Principal 'marikegerard' -PrincipalType Name # #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +$T | Format-Table -AutoSize * +$T = Get-GPOZaurrPermission -GPOName 'Default DOmain Policy' -Principal 'EVOTEC\marikegerard' -PrincipalType Name # #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +$T | Format-Table -AutoSize * +$T = Get-GPOZaurrPermission -GPOName 'Default DOmain Policy' -Principal 'S-1-5-18' -PrincipalType Sid # #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +$T | Format-Table -AutoSize * +$T = Get-GPOZaurrPermission -GPOName 'Default DOmain Policy' -Principal 'CN=Enterprise Admins,CN=Users,DC=ad,DC=evotec,DC=xyz' -PrincipalType DistinguishedName # #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject $T | Format-Table -AutoSize * \ No newline at end of file diff --git a/Examples/Example-08-ListingPermissioonsUnknown.ps1 b/Examples/Example-08-ListingPermissioonsUnknown.ps1 new file mode 100644 index 0000000..5bd2471 --- /dev/null +++ b/Examples/Example-08-ListingPermissioonsUnknown.ps1 @@ -0,0 +1,4 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +$T = Get-GPOZaurrPermission -Type Unknown -Verbose +$T | Format-Table * \ No newline at end of file diff --git a/Examples/Example-09-RemovingGPOPermissionUnknown.ps1 b/Examples/Example-09-RemovingGPOPermissionUnknown.ps1 index 0d976e6..fd0a2e5 100644 --- a/Examples/Example-09-RemovingGPOPermissionUnknown.ps1 +++ b/Examples/Example-09-RemovingGPOPermissionUnknown.ps1 @@ -1,3 +1,3 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force -Remove-GPOZaurrPermission -Verbose -Type Unknown -WhatIf \ No newline at end of file +Remove-GPOZaurrPermission -Verbose -Type Unknown -WhatIf -LimitProcessing 1 \ No newline at end of file diff --git a/Examples/Example-09-RemovingGPOpermissionNamed.ps1 b/Examples/Example-09-RemovingGPOpermissionNamed.ps1 index a4d49d4..94de55c 100644 --- a/Examples/Example-09-RemovingGPOpermissionNamed.ps1 +++ b/Examples/Example-09-RemovingGPOpermissionNamed.ps1 @@ -1,13 +1,6 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force -$Named = @( - 'S-1-5-21-853615985-2870445339-3163598659-1105' -) +$T = Get-GPOZaurrPermission -GPOName 'Default DOmain Policy' +$T | Format-Table -AutoSize * -# Using exclude permission types (it may not be good idea to delete GPORead/GPOApply) -#Remove-GPOZaurrPermission -Verbose -Type Named -WhatIf -LimitProcessing 2 -NamedObjects $Named -ExcludePermissionType GpoRead,GpoApply - -# But -#Remove-GPOZaurrPermission -Type Named -NamedObjects $Named -IncludePermissionType GpoEditDeleteModifySecurity -SkipWellKnown -SkipAdministrative -Verbose -WhatIf - -Remove-GPOZaurrPermission -Type Named -NamedObjects $Named -SkipWellKnown -SkipAdministrative -Verbose #-WhatIf \ No newline at end of file +Remove-GPOZaurrPermission -GPOName 'Default DOmain Policy' -Principal 'S-1-5-21-853615985-2870445339-3163598659-3755' -Verbose #-WhatIf #-IncludePermissionType GpoApply #-WhatIf \ No newline at end of file diff --git a/Examples/Example-10-ListingGPO.ps1 b/Examples/Example-10-ListingGPO.ps1 new file mode 100644 index 0000000..51b7b6a --- /dev/null +++ b/Examples/Example-10-ListingGPO.ps1 @@ -0,0 +1,6 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +Get-GPOZaurrAD | Format-Table +Get-GPOZaurrAD -Forest 'test.evotec.pl' | Format-Table + +Get-GPOZaurrAD -GPOName 'Default Domain Policy' -IncludeDomains 'ad.evotec.pl' | Format-Table \ No newline at end of file diff --git a/Examples/Example-10-ListingGPOLong.ps1 b/Examples/Example-10-ListingGPOLong.ps1 new file mode 100644 index 0000000..da7f629 --- /dev/null +++ b/Examples/Example-10-ListingGPOLong.ps1 @@ -0,0 +1,4 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +$GPOS = Get-GPOZaurr +$GPOS | Format-Table -AutoSize \ No newline at end of file diff --git a/Examples/Example-13-ListingOwners.ps1 b/Examples/Example-13-ListingOwners01.ps1 similarity index 100% rename from Examples/Example-13-ListingOwners.ps1 rename to Examples/Example-13-ListingOwners01.ps1 diff --git a/Examples/Example-13-ListingOwners02.ps1 b/Examples/Example-13-ListingOwners02.ps1 new file mode 100644 index 0000000..9fca0fc --- /dev/null +++ b/Examples/Example-13-ListingOwners02.ps1 @@ -0,0 +1,5 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +$T = Get-GPOZaurrOwner -Verbose -IncludeSysvol +$T | Format-Table * +#$T | Out-HtmlView -ScrollX \ No newline at end of file diff --git a/Examples/Example-17-FixInconsistentACL.ps1 b/Examples/Example-17-FixInconsistentACL.ps1 new file mode 100644 index 0000000..d12f6f5 --- /dev/null +++ b/Examples/Example-17-FixInconsistentACL.ps1 @@ -0,0 +1,10 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +#Get-GPOZaurrPermissionConsistency -Type All -Forest 'test.evotec.pl' | Format-Table +Get-GPOZaurrPermissionConsistency -Type Inconsistent | ForEach-Object { + $G = Get-GPOZaurrAD -GPOGuid $_.ID.GUID -IncludeDomains $_.DomainName + $P = Get-GPOZaurrPermission -GPOGuid $_.ID.GUID + $F = Get-WinADShare -Path $G.Path + $P | Format-Table + $F | Format-Table +} \ No newline at end of file diff --git a/Examples/Example-17-ListInconsistentACL.ps1 b/Examples/Example-17-ListInconsistentACL.ps1 new file mode 100644 index 0000000..16db852 --- /dev/null +++ b/Examples/Example-17-ListInconsistentACL.ps1 @@ -0,0 +1,4 @@ +Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force + +#Get-GPOZaurrPermissionConsistency -Type All -Forest 'test.evotec.pl' | Format-Table +Get-GPOZaurrPermissionConsistency -Type All | Format-Table \ No newline at end of file