Validate local password expiration on Windows 10

This commit is contained in:
2026-09-09 10:31:53 -06:00
parent 5e62a65316
commit 0b510082d4
5 changed files with 50 additions and 5 deletions
+2 -1
View File
@@ -593,7 +593,8 @@ finally {
Set-Item WSMan:\localhost\Client\TrustedHosts -Value $priorTrustedHosts -Force
}
if (-not $winRmWasRunning) {
Stop-Service WinRM -Force -ErrorAction SilentlyContinue
Stop-Service WinRM -Force -NoWait -WarningAction SilentlyContinue `
-ErrorAction SilentlyContinue
}
Remove-Item -LiteralPath $temporaryRoot -Recurse -Force -ErrorAction SilentlyContinue
$DomainCredential = $null