Disable reversible password storage for SGU accounts

This commit is contained in:
alexrg committed 2026-09-29 12:00:36 -06:00
1 parent 80baae1b54
commit 414a08ece6
9 files changed
+61 -46

No files matched your search

+5 -5
View File
@@ -202,7 +202,7 @@ if ($RemoteDesktopGroupDn) {
}
$managedUsersPasswordChangeCorrected = 0
$managedUsersReversibleEncryptionCorrected = 0
$managedUsersReversibleEncryptionDisabled = 0
$sguRoleGroupDns = @($ProfessorGroupDn, $StudentGroupDn, $AdministrativeGroupDn)
$sguRoleUserDns = [Collections.Generic.HashSet[string]]::new([StringComparer]::OrdinalIgnoreCase)
foreach ($roleGroupDn in $sguRoleGroupDns) {
@@ -224,10 +224,10 @@ if ($PSCmdlet.ShouldProcess($usersOuDn, 'Deny direct password changes for every
$managedUsersPasswordChangeCorrected++
}
if ($sguRoleUserDns.Contains($managedUser.DistinguishedName) -and
-not $managedUser.AllowReversiblePasswordEncryption) {
$managedUser.AllowReversiblePasswordEncryption) {
Set-ADAccountControl -Identity $managedUser.DistinguishedName `
-AllowReversiblePasswordEncryption $true -Server $LdapHost -Confirm:$false
$managedUsersReversibleEncryptionCorrected++
-AllowReversiblePasswordEncryption $false -Server $LdapHost -Confirm:$false
$managedUsersReversibleEncryptionDisabled++
}
}
}
@@ -389,4 +389,4 @@ if ($PSCmdlet.ShouldProcess($installPath, 'Install the SGU Authentication Broker
Get-Service -Name $serviceName | Select-Object Name, Status, StartType,
@{ Name = 'EventLog'; Expression = { $brokerEventLogName } },
@{ Name = 'ExistingUsersPasswordChangeDenied'; Expression = { $managedUsersPasswordChangeCorrected } },
@{ Name = 'ExistingSguRoleUsersReversibleEncryptionEnabled'; Expression = { $managedUsersReversibleEncryptionCorrected } }
@{ Name = 'ExistingSguRoleUsersReversibleEncryptionDisabled'; Expression = { $managedUsersReversibleEncryptionDisabled } }