From d9211a77df67a659bac9458636da76a96a31d4a4 Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 18 Sep 2025 22:53:16 +0200 Subject: [PATCH] feat: Update command to set user password policy (#1407) --- assets/win11x64-enterprise-eval.xml | 2 +- assets/win11x64-enterprise.xml | 2 +- assets/win11x64-iot.xml | 2 +- assets/win11x64-ltsc.xml | 2 +- assets/win11x64.xml | 2 +- assets/win2025-eval.xml | 2 +- assets/win2025.xml | 2 +- src/install.sh | 1 + 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/assets/win11x64-enterprise-eval.xml b/assets/win11x64-enterprise-eval.xml index 39caac3..a354801 100644 --- a/assets/win11x64-enterprise-eval.xml +++ b/assets/win11x64-enterprise-eval.xml @@ -358,7 +358,7 @@ 5 - cmd /C wmic useraccount where name="Docker" set PasswordExpires=false + powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1 Password Never Expires diff --git a/assets/win11x64-enterprise.xml b/assets/win11x64-enterprise.xml index 1c18bf7..99d86a5 100644 --- a/assets/win11x64-enterprise.xml +++ b/assets/win11x64-enterprise.xml @@ -361,7 +361,7 @@ 5 - cmd /C wmic useraccount where name="Docker" set PasswordExpires=false + powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1 Password Never Expires diff --git a/assets/win11x64-iot.xml b/assets/win11x64-iot.xml index 3ee4107..699d176 100644 --- a/assets/win11x64-iot.xml +++ b/assets/win11x64-iot.xml @@ -361,7 +361,7 @@ 5 - cmd /C wmic useraccount where name="Docker" set PasswordExpires=false + powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1 Password Never Expires diff --git a/assets/win11x64-ltsc.xml b/assets/win11x64-ltsc.xml index 5bc5187..20cbfd4 100644 --- a/assets/win11x64-ltsc.xml +++ b/assets/win11x64-ltsc.xml @@ -361,7 +361,7 @@ 5 - cmd /C wmic useraccount where name="Docker" set PasswordExpires=false + powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1 Password Never Expires diff --git a/assets/win11x64.xml b/assets/win11x64.xml index f3fc68c..4919df1 100644 --- a/assets/win11x64.xml +++ b/assets/win11x64.xml @@ -361,7 +361,7 @@ 5 - cmd /C wmic useraccount where name="Docker" set PasswordExpires=false + powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1 Password Never Expires diff --git a/assets/win2025-eval.xml b/assets/win2025-eval.xml index d86f152..d781af7 100644 --- a/assets/win2025-eval.xml +++ b/assets/win2025-eval.xml @@ -257,7 +257,7 @@ 5 - cmd /C wmic useraccount where name="Docker" set PasswordExpires=false + powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1 Password Never Expires diff --git a/assets/win2025.xml b/assets/win2025.xml index d488ae2..f6974f6 100644 --- a/assets/win2025.xml +++ b/assets/win2025.xml @@ -260,7 +260,7 @@ 5 - cmd /C wmic useraccount where name="Docker" set PasswordExpires=false + powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1 Password Never Expires diff --git a/src/install.sh b/src/install.sh index dc8cc0a..46bc3fd 100644 --- a/src/install.sh +++ b/src/install.sh @@ -790,6 +790,7 @@ updateXML() { user=$(echo "$USERNAME" | sed 's/[^[:alnum:]@!._-]//g') if [ -n "$user" ]; then + sed -i "s/-name \"Docker\"/-name \"$user\"/g" "$asset" sed -i "s/Docker<\/Name>/$user<\/Name>/g" "$asset" sed -i "s/where name=\"Docker\"/where name=\"$user\"/g" "$asset" sed -i "s/Docker<\/FullName>/$user<\/FullName>/g" "$asset"