Change local Administrator password SECURE

by Apr 4, 2017

Hi Guys ! 

I've got a big problem to solve, i want to change local Administrator password in secure mode, i want to encrypt the password. I don't wanto use GPO.

I wrote this lines: if i explict the password works regularly, but if i use a secure string give me error.

Powershell
Clear-Host

$a = read-host "Insert password" -asSecureString

$Admin=[adsi]("WinNT://$env:COMPUTERNAME/Administrator, user")
$Admin.SetPassword($a)