From 6f546f5e2533e74f3ab564819781ce41e7f34a2c Mon Sep 17 00:00:00 2001 From: adisbladis Date: Mon, 29 Jun 2020 11:33:04 +0200 Subject: [PATCH] Disable password expiry Since we set RTC in the Nix build it's likely that any passwords have expired since the image generation RTC time. Ideally this should be applied in autounattend.xml but it didn't work out either as FirstLogonCommands or as a command in the specialize pass. --- wfvm/win.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wfvm/win.nix b/wfvm/win.nix index 7f9376d..9153d39 100644 --- a/wfvm/win.nix +++ b/wfvm/win.nix @@ -156,7 +156,17 @@ let echo "Done" mv c.img $out - '')) baseImage installCommands; + '')) baseImage ( + [ + { + name = "DisablePasswordExpiry"; + script = '' + win exec 'wmic UserAccount set PasswordExpires=False' + ''; + } + ] ++ + installCommands + ); in