上脚本吧,找半天

$password = "yourpassword"
$pwd = $password | ConvertTo-SecureString -asPlainText -Force
Get-LocalUser -Name "Administrator" | Set-LocalUser -Password $pwd

powershell的不同版本导致有些命令在不同的OS下不能使用

参考:https://www.thomasmaurer.ch/2018/07/manage-local-windows-user-powershell/

相关文章: