mirror of
https://github.com/fleetdm/fleet
synced 2026-05-04 05:48:26 +00:00
As part of this PR #20224, I added the new script to one location but didn't notice that it wasn't included in the embedded scripts directory. This also adds an unlock script that will reset the registry values to their original settings
21 lines
785 B
PowerShell
21 lines
785 B
PowerShell
# PowerShell script to enable all disabled local user accounts
|
|
|
|
# Get all local user accounts
|
|
$localUsers = Get-LocalUser
|
|
|
|
# Enable each disabled user account
|
|
foreach ($user in $localUsers) {
|
|
if ($user.Enabled -eq $false) {
|
|
Enable-LocalUser -Name $user.Name
|
|
Write-Host "Enabled user account: $($user.Name)"
|
|
}
|
|
}
|
|
|
|
Write-Host "All disabled user accounts have been enabled."
|
|
|
|
|
|
# Re-enable additional AD logins
|
|
New-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\Settings\AllowSignInOptions" -Name 'value' -Value 0 -PropertyType DWORD -Force
|
|
|
|
# Re-enable cached logins for AD/Azure/Entra accounts
|
|
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\" -Name 'CachedLogonsCount' -Value 10 -PropertyType String -Force
|