Merge pull request #205 from mbrancato/dev

Fix errors gathering the forest SID
This commit is contained in:
HarmJ0y 2017-01-07 18:20:56 -08:00 committed by GitHub
commit 8552033242
1 changed files with 2 additions and 2 deletions

View File

@ -3891,10 +3891,10 @@ to the forest root domain SID.
if ($ForestObject) {
# get the SID of the forest root
if ($PSBoundParameters['Credential']) {
$ForestSid = ConvertTo-SID -ObjectName "krbtgt@$($ForestObject.RootDomain)" -Credential $Credential
$ForestSid = (Get-DomainUser -Identity "krbtgt" -Domain $ForestObject.RootDomain.Name -Credential $Credential).objectsid
}
else {
$ForestSid = ConvertTo-SID -ObjectName "krbtgt@$($ForestObject.RootDomain)"
$ForestSid = (Get-DomainUser -Identity "krbtgt" -Domain $ForestObject.RootDomain.Name).objectsid
}
$Parts = $ForestSid -Split '-'