Skip to content

Commit

Permalink
Fix account lockout threshold sort logic
Browse files Browse the repository at this point in the history
account lockout threshold of 0 = never lock out; fix logic introduced by sorting by that field. ref dafthack#19 (comment)
  • Loading branch information
mdavis332 authored Mar 13, 2020
1 parent 1c550cb commit 9ac1fe3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion private/Get-DomainPasswordPolicy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Get-DomainPasswordPolicy {

# Generate a userlist from the domain
# Selecting the lowest account lockout threshold in the domain to avoid locking out any accounts.
[int]$SmallestLockoutThreshold = $AccountLockoutThresholds | Sort-Object | Select-Object -First 1
[int]$SmallestLockoutThreshold = $AccountLockoutThresholds -replace 0, 9999 | Sort-Object | Select-Object -First 1

$AcctLockoutThreshold = @{Name = 'Account Lockout Threshold (Invalid logon attempts)'; Expression = { $SmallestLockoutThreshold } }

Expand Down

0 comments on commit 9ac1fe3

Please sign in to comment.