Skip to content

Commit

Permalink
bugfies to fix error catching and calling name
Browse files Browse the repository at this point in the history
  • Loading branch information
sussurro committed Jun 28, 2021
1 parent 9728e42 commit bcf71e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion AD_SPN_Randomizer/GenerateRandomSPNs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
$service = $services | get-Random
$cn = $computer.Name
$spn = "$service/$cn"
$user | Set-ADUser -ServicePrincipalNames @{Add=$spn}

Try {
$user | Set-ADUser -ServicePrincipalNames @{Add=$spn} -ErrorAction Stop
}Catch { $i--}

$i++
} While($i -lt $SPNCount)
Expand Down
2 changes: 1 addition & 1 deletion Invoke-BadBlood.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ if ($badblood -eq 'badblood') {

write-host "Creating random SPNs" -ForegroundColor Green
.($basescriptpath + '\AD_SPN_Randomizer\GenerateRandomSPNs.ps1')
CreateRandomSPNs -Count 50
CreateRandomSPNs -SPNCount 50



Expand Down

0 comments on commit bcf71e6

Please sign in to comment.