Skip to content

Commit

Permalink
feat: localized local administrator (vmware-samples#334)
Browse files Browse the repository at this point in the history
Add support for disabling password expiration for the local administrator account (non-English) localized Windows guest operating systems.

Closes: vmware-samples#332

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
tenthirtyam committed Nov 5, 2022
1 parent f8da1db commit 702f570
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/windows/windows-prepare.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders

# Disable Password Expiration for the Administrator Accounts - (Administrator and Build)
Write-Output "Disabling password expiration for the local Administrator accounts..."
Set-LocalUser Administrator -PasswordNeverExpires $true
Set-LocalUser $BUILD_USERNAME -PasswordNeverExpires $true
$localAdministrator = (Get-LocalUser | Where-Object { $_.sid -like '*-500' }).name
Set-LocalUser -Name $localAdministrator -PasswordNeverExpires $true
Set-LocalUser -Name $BUILD_USERNAME -PasswordNeverExpires $true

# Enable Remote Desktop.
Write-Output "Enabling Remote Desktop..."
Expand Down

0 comments on commit 702f570

Please sign in to comment.