From a6a847d720a72d5ad13a6e9b25c38ac280d1ea25 Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Wed, 11 Nov 2020 21:27:04 +0100 Subject: [PATCH] Update --- ...ser.ps1 => Example-15-AddPermission01.ps1} | 1 + ...r02.ps1 => Example-15-AddPermission02.ps1} | 0 Examples/Example-15-FixingGPOPermissions.ps1 | 3 --- .../Example-16-AddRemoveGPOPermission01.ps1 | 26 +++++++++++-------- 4 files changed, 16 insertions(+), 14 deletions(-) rename Examples/{Example-15-AddPermissionAuthenticatedUser.ps1 => Example-15-AddPermission01.ps1} (99%) rename Examples/{Example-15-AddPermissionAuthenticatedUser02.ps1 => Example-15-AddPermission02.ps1} (100%) delete mode 100644 Examples/Example-15-FixingGPOPermissions.ps1 diff --git a/Examples/Example-15-AddPermissionAuthenticatedUser.ps1 b/Examples/Example-15-AddPermission01.ps1 similarity index 99% rename from Examples/Example-15-AddPermissionAuthenticatedUser.ps1 rename to Examples/Example-15-AddPermission01.ps1 index a106b4d..e0cfc46 100644 --- a/Examples/Example-15-AddPermissionAuthenticatedUser.ps1 +++ b/Examples/Example-15-AddPermission01.ps1 @@ -1,4 +1,5 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force Add-GPOZaurrPermission -Type AuthenticatedUsers -PermissionType GpoRead -LimitProcessing 3 -All -WhatIf -Verbose #-IncludeDomains 'ad.evotec.pl' + Add-GPOZaurrPermission -Type Administrative -PermissionType GpoEditDeleteModifySecurity -LimitProcessing 100 -All -WhatIf -Verbose #-IncludeDomains 'ad.evotec.pl' \ No newline at end of file diff --git a/Examples/Example-15-AddPermissionAuthenticatedUser02.ps1 b/Examples/Example-15-AddPermission02.ps1 similarity index 100% rename from Examples/Example-15-AddPermissionAuthenticatedUser02.ps1 rename to Examples/Example-15-AddPermission02.ps1 diff --git a/Examples/Example-15-FixingGPOPermissions.ps1 b/Examples/Example-15-FixingGPOPermissions.ps1 deleted file mode 100644 index 87d3113..0000000 --- a/Examples/Example-15-FixingGPOPermissions.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force - -Get-GPOZaurrLink | Format-Table -AutoSize \ No newline at end of file diff --git a/Examples/Example-16-AddRemoveGPOPermission01.ps1 b/Examples/Example-16-AddRemoveGPOPermission01.ps1 index e598d1e..0e8c6d9 100644 --- a/Examples/Example-16-AddRemoveGPOPermission01.ps1 +++ b/Examples/Example-16-AddRemoveGPOPermission01.ps1 @@ -1,17 +1,21 @@ Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force -Clear-Host +#$T = Get-GPOZaurrPermission -GPOName 'ALL | Enable RDP' #-IncludeGPOObject #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +#$T | Format-Table -AutoSize * -$T = Get-GPOZaurrPermission -GPOName 'ALL | Enable RDP' #-IncludeGPOObject #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject -$T | Format-Table -AutoSize * +#Add-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'CN=Przemysław Kłys,OU=Users,OU=Accounts,OU=Production,DC=ad,DC=evotec,DC=xyz' -PrincipalType DistinguishedName -Verbose #-WhatIf +#Add-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'przemyslaw.klys' -PrincipalType Name -Verbose #-WhatIf +#Add-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'S-1-5-21-853615985-2870445339-3163598659-1105' -PrincipalType Sid -Verbose #-WhatIf -Add-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'przemyslaw.klys' -Verbose +#$T = Get-GPOZaurrPermission -GPOName 'ALL | Enable RDP' #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +#$T | Format-Table -AutoSize * -$T = Get-GPOZaurrPermission -GPOName 'ALL | Enable RDP' #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject -$T | Format-Table -AutoSize * +Add-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEditDeleteModifySecurity -Principal 'Domain Admins' -PrincipalType Name -Verbose #-WhatIf +#Remove-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'przemyslaw.klys' -PrincipalType Name -Verbose #-WhatIf +#Remove-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'EVOTEC\przemyslaw.klys' -PrincipalType NetbiosName -Verbose #-WhatIf +#Remove-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'CN=Przemysław Kłys,OU=Users,OU=Accounts,OU=Production,DC=ad,DC=evotec,DC=xyz' -PrincipalType DistinguishedName -Verbose #-WhatIf +#Remove-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Type NotAdministrative -Verbose -Add-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEditDeleteModifySecurity -Principal 'Domain Admins' -Verbose -Remove-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEdit -Principal 'przemyslaw.klys' -PrincipalType Name -Verbose - -$T = Get-GPOZaurrPermission -GPOName 'ALL | Enable RDP' #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject -$T | Format-Table -AutoSize * \ No newline at end of file +Remove-GPOZaurrPermission -GPOName 'ALL | Enable RDP' -PermissionType GpoEditDeleteModifySecurity -PrincipalType DistinguishedName -Principal 'CN=Domain Admins,CN=Users,DC=ad,DC=evotec,DC=pl' -Verbose +#$T = Get-GPOZaurrPermission -GPOName 'ALL | Enable RDP' #-ExcludePermissionType GpoApply,GpoRead -IncludeGPOObject +#$T | Format-Table -AutoSize * \ No newline at end of file