The*_*oob 0 script powershell passwords batch vbscript
我需要将本地机器(没有网络或域,只有机器)上的密码批量重置为单个密码;例如 %1Percent 。我想知道这是否可以通过批处理或电源外壳或某种脚本实现。
使用 Powershell(需要管理员权限):
#Requires -RunAsAdministrator
$SecurePassword = Read-Host -Prompt "Enter password for all users" -AsSecureString
$Exclude = "Administrator","Guest","DefaultAccount"
Get-LocalUser |
Where {$Exclude -notcontains $_.Name} |
Set-Localuser -Password $SecurePassword
Run Code Online (Sandbox Code Playgroud)