Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
22 views
1 page
Get GPODelegation
Uploaded by
conapoh603
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save Get-GPODelegation For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
22 views
1 page
Get GPODelegation
Uploaded by
conapoh603
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Get-GPODelegation For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Get-GPODelegation For Later
You are on page 1
/ 1
Search
Fullscreen
■<#
Author: Itamar Mizrahi (@MrAnde7son)
License: GNU v3
Required Dependencies: None
Optional Dependencies: None
#>
function Get-GPODelegation
{
<#
.SYNOPSIS
Finds users with write permissions on GPO objects which may allow privilege escalation within the
Author: Itamar Mizrahi (@MrAnde7son)
License: GNU v3
Required Dependencies: None
Optional Dependencies: None
.DESCRIPTION
.PARAMETER GPOName
The GPO display name to query for, wildcards accepted.
.PARAMETER PageSize
.EXAMPLE
PS C:\> Get-GPODelegation
Returns all GPO delegations in current forest.
.EXAMPLE
PS C:\> Get-GPODelegation -GPOName
Returns all GPO delegations on a given GPO.
#>
[CmdletBinding()]
Param (
[String]
$GPOName = '*',
[ValidateRange(1,10000)]
[Int]
$PageSize = 200
)
$Exclusions = @("SYSTEM","Domain Admins","Enterprise Admins")
$listGPO = @()
$Results = @()
$Forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$DomainList = @($Forest.Domains)
$Domains = $DomainList | foreach { $_.GetDirectoryEntry() }
foreach ($Domain in $Domains) {
$Filter = "(&(objectCategory=groupPolicyContainer)(displayname=$GPOName))"
$Searcher = New-Object System.DirectoryServices.DirectorySearcher
$Searcher.SearchRoot = $Domain
$Searcher.Filter = $Filter
$Searcher.PageSize = $PageSize
$Searcher.SearchScope = "Subtree"
$listGPO += $Searcher.FindAll()
foreach ($gpo in $listGPO){
$ACL = ([ADSI]$gpo.path).ObjectSecurity.Access | ? {$_.ActiveDirectoryRights -match "Write" -
if ($ACL -ne $null){
$GpoACL = New-Object psobject
$GpoACL | Add-Member Noteproperty 'ADSPath' $gpo.Properties.adspath
$GpoACL | Add-Member Noteproperty 'GPODisplayName' $gpo.Properties.displayname
$GpoACL | Add-Member Noteproperty 'IdentityReference' $ACL.IdentityReference
$GpoACL | Add-Member Noteproperty 'ActiveDirectoryRights' $ACL.ActiveDirectoryRights
$Results += $GpoACL
}
}
}
return $Results
}
You might also like
4 DC01
PDF
No ratings yet
4 DC01
12 pages
CRTP
PDF
No ratings yet
CRTP
30 pages
ADRecon
PDF
No ratings yet
ADRecon
189 pages
Window & Active Directory Exploitation Cheat Sheet
PDF
No ratings yet
Window & Active Directory Exploitation Cheat Sheet
42 pages
CRTE Notes
PDF
No ratings yet
CRTE Notes
12 pages
Power Shell
PDF
No ratings yet
Power Shell
90 pages
Group Policy Basics
PDF
No ratings yet
Group Policy Basics
57 pages
Latest Microsoft EnsurePass 70 411 Dumps PDF 04 35
PDF
No ratings yet
Latest Microsoft EnsurePass 70 411 Dumps PDF 04 35
150 pages
AD Privileged Audit - ps1
PDF
No ratings yet
AD Privileged Audit - ps1
24 pages
Group Policy Registry Table
PDF
No ratings yet
Group Policy Registry Table
21 pages
Sysadmin Magazine July 2023
PDF
No ratings yet
Sysadmin Magazine July 2023
21 pages
CRTP Checklist
PDF
No ratings yet
CRTP Checklist
255 pages
Attcking Ad For Fun and Profit 1 PDF
PDF
100% (1)
Attcking Ad For Fun and Profit 1 PDF
93 pages
5 Troubleshooting and Backing Up GPOs
PDF
No ratings yet
5 Troubleshooting and Backing Up GPOs
51 pages
Gpresult Default Save Location
PDF
No ratings yet
Gpresult Default Save Location
3 pages
Ad PEAS
PDF
No ratings yet
Ad PEAS
389 pages
Abusing Laps Paper
PDF
No ratings yet
Abusing Laps Paper
10 pages
All Adds Powershell Command
PDF
No ratings yet
All Adds Powershell Command
6 pages
ADACLScan
PDF
No ratings yet
ADACLScan
253 pages
AD and Windows Exploitation Cheat Sheet
PDF
No ratings yet
AD and Windows Exploitation Cheat Sheet
31 pages
Active Directory Useful Powershell Commands and Scripts 1739748834
PDF
No ratings yet
Active Directory Useful Powershell Commands and Scripts 1739748834
49 pages
CRTP Command Checklists
PDF
No ratings yet
CRTP Command Checklists
6 pages
Group Policy Cmdlets in Windows PowerShell
PDF
No ratings yet
Group Policy Cmdlets in Windows PowerShell
3 pages
Active Directory Exploitation Cheat Sheet: Share
PDF
100% (1)
Active Directory Exploitation Cheat Sheet: Share
14 pages
Group Policy - GPResult Examples - The Sysadmins
PDF
No ratings yet
Group Policy - GPResult Examples - The Sysadmins
6 pages
Group Policy Cmdlets in Windows PowerShell
PDF
No ratings yet
Group Policy Cmdlets in Windows PowerShell
3 pages
Lab Lec 4 Applying GPO
PDF
No ratings yet
Lab Lec 4 Applying GPO
12 pages
ADSec Assessment
PDF
No ratings yet
ADSec Assessment
6 pages
How To Run GPO Logon Script Only Once? - Windows OS Hub
PDF
No ratings yet
How To Run GPO Logon Script Only Once? - Windows OS Hub
1 page
Gpo Setting
PDF
No ratings yet
Gpo Setting
5 pages
Invoke ACLScanner
PDF
No ratings yet
Invoke ACLScanner
2 pages
Console Output
PDF
No ratings yet
Console Output
2 pages
Windows & Active Directory Exploitation
PDF
No ratings yet
Windows & Active Directory Exploitation
30 pages
Windows & Active Directory Exploitation Cheat Sheet and Command Reference
PDF
No ratings yet
Windows & Active Directory Exploitation Cheat Sheet and Command Reference
31 pages
Monteverde
PDF
No ratings yet
Monteverde
16 pages
Offensive Enumeration in Ad
PDF
No ratings yet
Offensive Enumeration in Ad
13 pages
Active Directory Command Line One
PDF
No ratings yet
Active Directory Command Line One
9 pages
Get ServiceAcl
PDF
No ratings yet
Get ServiceAcl
2 pages
User Attributes AD Command
PDF
No ratings yet
User Attributes AD Command
3 pages
LDAP Queries For Offensive and Defensive Operations
PDF
No ratings yet
LDAP Queries For Offensive and Defensive Operations
16 pages
Introduction To Active Directory Module Cheat Sheet
PDF
No ratings yet
Introduction To Active Directory Module Cheat Sheet
3 pages
DCAudit Upgrade
PDF
No ratings yet
DCAudit Upgrade
5 pages
Administrative Task Script Name Description: Dont Forget GPMC Scripts
PDF
No ratings yet
Administrative Task Script Name Description: Dont Forget GPMC Scripts
4 pages
Escape Two
PDF
No ratings yet
Escape Two
16 pages
PowerView-3.0 Tips and Tricks
PDF
No ratings yet
PowerView-3.0 Tips and Tricks
8 pages
Notes
PDF
No ratings yet
Notes
8 pages
ADPowerShell QuickReference
PDF
No ratings yet
ADPowerShell QuickReference
2 pages
Windows - Privilege Escalation - Internal All The Things
PDF
No ratings yet
Windows - Privilege Escalation - Internal All The Things
3 pages
Get - Active - Directory - Information - With - PowerShell - Script - 1737381381 L
PDF
No ratings yet
Get - Active - Directory - Information - With - PowerShell - Script - 1737381381 L
3 pages
Offensive Enumeration in
PDF
No ratings yet
Offensive Enumeration in
13 pages
PowerView PDF
PDF
No ratings yet
PowerView PDF
2 pages
TechNet Group Policy Tips and Tricks
PDF
No ratings yet
TechNet Group Policy Tips and Tricks
30 pages
Adreport ps1 v2
PDF
No ratings yet
Adreport ps1 v2
29 pages
Active Directory Information Search
PDF
No ratings yet
Active Directory Information Search
1 page
Powershell AD
PDF
No ratings yet
Powershell AD
6 pages
Essential n8n Playbook
From Everand
Essential n8n Playbook
Leandro Calado
No ratings yet
Azure For Starters
From Everand
Azure For Starters
Chinmoy Mukherjee
No ratings yet
50 Recipes for Programming Angular
From Everand
50 Recipes for Programming Angular
Jamie Munro
4/5 (1)
MCTS 70-515 Exam: Web Applications Development with Microsoft .NET Framework 4 (Exam Prep)
From Everand
MCTS 70-515 Exam: Web Applications Development with Microsoft .NET Framework 4 (Exam Prep)
Eddie Vi
4/5 (1)
How to a Developers Guide to 4k: Developer edition, #3
From Everand
How to a Developers Guide to 4k: Developer edition, #3
Xinc Cyberwizard
No ratings yet