Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit d0e4e27

Browse files
committed
Convert-LDAPProperty now properly parses sidHistory with multiple values
1 parent 0351663 commit d0e4e27

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Recon/PowerView.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,8 +2790,8 @@ A custom PSObject with LDAP hashtable properties translated.
27902790
$Properties.PropertyNames | ForEach-Object {
27912791
if ($_ -ne 'adspath') {
27922792
if (($_ -eq 'objectsid') -or ($_ -eq 'sidhistory')) {
2793-
# convert the SID to a string
2794-
$ObjectProperties[$_] = (New-Object System.Security.Principal.SecurityIdentifier($Properties[$_][0], 0)).Value
2793+
# convert all listed sids (i.e. if multiple are listed in sidHistory)
2794+
$ObjectProperties[$_] = $Properties[$_] | ForEach-Object { (New-Object System.Security.Principal.SecurityIdentifier($_, 0)).Value }
27952795
}
27962796
elseif ($_ -eq 'grouptype') {
27972797
$ObjectProperties[$_] = $Properties[$_][0] -as $GroupTypeEnum
@@ -6374,7 +6374,7 @@ https://blogs.technet.microsoft.com/pie/2014/08/25/metadata-1-when-did-the-deleg
63746374
}
63756375
}
63766376
else {
6377-
Write-Verbose "[Get-DomainObjectHistory] Error retrieving 'msds-replattributemetadata' for '$ObjectDN'"
6377+
Write-Verbose "[Get-DomainObjectAttributeHistory] Error retrieving 'msds-replattributemetadata' for '$ObjectDN'"
63786378
}
63796379
}
63806380
}

0 commit comments

Comments
 (0)