Password reset windows powershell

From UVOO Tech Wiki
Revision as of 14:48, 14 December 2023 by Busk (talk | contribs) (Created page with "# Local user ``` $password = Read-Host -AsSecureString $UserAccount = Get-LocalUser -Name "User02" $UserAccount | Set-LocalUser -Password $password ``` # AD ``` $password = (...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Local user

$password = Read-Host -AsSecureString
$UserAccount = Get-LocalUser -Name "User02"
$UserAccount | Set-LocalUser -Password $password

$password = (Read-Host -Prompt "Provide New Password" -AsSecureString)
Set-ADAccountPassword -Identity foo -Password $password