mirror of
https://github.com/PowerShellMafia/PowerSploit
synced 2026-06-08 12:13:33 +00:00
Modify dependent functions
This commit is contained in:
+4
-4
@@ -5359,15 +5359,15 @@ function Get-NetGroupMember {
|
||||
if ($Recurse -and $UseMatchingRule) {
|
||||
# resolve the group to a distinguishedname
|
||||
if ($GroupName) {
|
||||
$Group = Get-NetGroup -GroupName $GroupName -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
|
||||
$Group = Get-NetGroup -AllTypes -GroupName $GroupName -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
|
||||
}
|
||||
elseif ($SID) {
|
||||
$Group = Get-NetGroup -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
|
||||
$Group = Get-NetGroup -AllTypes -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
|
||||
}
|
||||
else {
|
||||
# default to domain admins
|
||||
$SID = (Get-DomainSID -Domain $TargetDomain -DomainController $TargetDomainController) + "-512"
|
||||
$Group = Get-NetGroup -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
|
||||
$Group = Get-NetGroup -AllTypes -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
|
||||
}
|
||||
$GroupDN = $Group.distinguishedname
|
||||
$GroupFoundName = $Group.samaccountname
|
||||
@@ -13056,7 +13056,7 @@ function Find-ManagedSecurityGroups {
|
||||
#>
|
||||
|
||||
# Go through the list of security groups on the domain and identify those who have a manager
|
||||
Get-NetGroup -FullData -Filter '(&(managedBy=*)(groupType:1.2.840.113556.1.4.803:=2147483648))' | Select-Object -Unique distinguishedName,managedBy,cn | ForEach-Object {
|
||||
Get-NetGroup -FullData -Filter '(managedBy=*)' | Select-Object -Unique distinguishedName,managedBy,cn | ForEach-Object {
|
||||
|
||||
# Retrieve the object that the managedBy DN refers to
|
||||
$group_manager = Get-ADObject -ADSPath $_.managedBy | Select-Object cn,distinguishedname,name,samaccounttype,samaccountname
|
||||
|
||||
Reference in New Issue
Block a user