mirror of
				https://github.com/dockur/windows.git
				synced 2025-10-31 18:52:39 +08:00 
			
		
		
		
	feat: Update command to set user password policy (#1407)
This commit is contained in:
		| @@ -358,7 +358,7 @@ | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|           <Order>5</Order> | ||||
|           <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> | ||||
|           <CommandLine>powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1</CommandLine> | ||||
|           <Description>Password Never Expires</Description> | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|   | ||||
| @@ -361,7 +361,7 @@ | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|           <Order>5</Order> | ||||
|           <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> | ||||
|           <CommandLine>powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1</CommandLine> | ||||
|           <Description>Password Never Expires</Description> | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|   | ||||
| @@ -361,7 +361,7 @@ | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|           <Order>5</Order> | ||||
|           <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> | ||||
|           <CommandLine>powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1</CommandLine> | ||||
|           <Description>Password Never Expires</Description> | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|   | ||||
| @@ -361,7 +361,7 @@ | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|           <Order>5</Order> | ||||
|           <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> | ||||
|           <CommandLine>powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1</CommandLine> | ||||
|           <Description>Password Never Expires</Description> | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|   | ||||
| @@ -361,7 +361,7 @@ | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|           <Order>5</Order> | ||||
|           <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> | ||||
|           <CommandLine>powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1</CommandLine> | ||||
|           <Description>Password Never Expires</Description> | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|   | ||||
| @@ -257,7 +257,7 @@ | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|           <Order>5</Order> | ||||
|           <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> | ||||
|           <CommandLine>powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1</CommandLine> | ||||
|           <Description>Password Never Expires</Description> | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|   | ||||
| @@ -260,7 +260,7 @@ | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|           <Order>5</Order> | ||||
|           <CommandLine>cmd /C wmic useraccount where name="Docker" set PasswordExpires=false</CommandLine> | ||||
|           <CommandLine>powershell.exe -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive set-localuser -name "Docker" -passwordneverexpires 1</CommandLine> | ||||
|           <Description>Password Never Expires</Description> | ||||
|         </SynchronousCommand> | ||||
|         <SynchronousCommand wcm:action="add"> | ||||
|   | ||||
| @@ -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/<Name>Docker<\/Name>/<Name>$user<\/Name>/g" "$asset" | ||||
|     sed -i "s/where name=\"Docker\"/where name=\"$user\"/g" "$asset" | ||||
|     sed -i "s/<FullName>Docker<\/FullName>/<FullName>$user<\/FullName>/g" "$asset" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kroese
					Kroese