githubEdit

force-change-password

Create a PS Credential object (owned user cred)

$password = ConvertTo-SecureString '<PASSWORD>' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential('INLANEFREIGHT\wley', $password)

Create a new user secure string object

$newPass = ConvertTo-SecureString 'Password@123' -AsPlainText -Force

Change user's password

PowerView.ps1arrow-up-right

Set-DomainUserPassword -Identity damundsen -AccountPassword $newPass -Credential $cred -Verbose

Create password object

$UserPassword = ConvertTo-SecureString 'Password@123' -AsPlainText -Force

Set password

Set-DomainUserPassword -Identity andy -AccountPassword $UserPassword

Last updated