I’m trying to use automox to reset a local user on a bunch of windows 10 machines. But I keep getting an error.
# Define the username and new password
$scriptBlock = {
$adminUsername = "Local User"
$newPassword = "Password"
$securePassword = ConvertTo-SecureString -String $newPassword -AsPlainText -Force
Set-LocalUser -Name $adminUsername -Password $securePassword -ErrorAction SilentlyContinue
}
$exitCode = & "$env:SystemRoot\sysnative\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -WindowStyle Hidden -NoProfile -NonInteractive -Command $scriptBlock
Anyone been able to make this work?