Skip to content

Commit 917a095

Browse files
committed
Modify dependent functions
1 parent 462c6e8 commit 917a095

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Recon/PowerView.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5359,15 +5359,15 @@ function Get-NetGroupMember {
53595359
if ($Recurse -and $UseMatchingRule) {
53605360
# resolve the group to a distinguishedname
53615361
if ($GroupName) {
5362-
$Group = Get-NetGroup -GroupName $GroupName -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
5362+
$Group = Get-NetGroup -AllTypes -GroupName $GroupName -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
53635363
}
53645364
elseif ($SID) {
5365-
$Group = Get-NetGroup -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
5365+
$Group = Get-NetGroup -AllTypes -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
53665366
}
53675367
else {
53685368
# default to domain admins
53695369
$SID = (Get-DomainSID -Domain $TargetDomain -DomainController $TargetDomainController) + "-512"
5370-
$Group = Get-NetGroup -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
5370+
$Group = Get-NetGroup -AllTypes -SID $SID -Domain $TargetDomain -DomainController $TargetDomainController -Credential $Credential -FullData -PageSize $PageSize
53715371
}
53725372
$GroupDN = $Group.distinguishedname
53735373
$GroupFoundName = $Group.samaccountname
@@ -13056,7 +13056,7 @@ function Find-ManagedSecurityGroups {
1305613056
#>
1305713057

1305813058
# Go through the list of security groups on the domain and identify those who have a manager
13059-
Get-NetGroup -FullData -Filter '(&(managedBy=*)(groupType:1.2.840.113556.1.4.803:=2147483648))' | Select-Object -Unique distinguishedName,managedBy,cn | ForEach-Object {
13059+
Get-NetGroup -FullData -Filter '(managedBy=*)' | Select-Object -Unique distinguishedName,managedBy,cn | ForEach-Object {
1306013060

1306113061
# Retrieve the object that the managedBy DN refers to
1306213062
$group_manager = Get-ADObject -ADSPath $_.managedBy | Select-Object cn,distinguishedname,name,samaccounttype,samaccountname

0 commit comments

Comments
 (0)