View Single Post
Old 09-25-2006   #2 (permalink)
James Truher


 
 

Re: HowTo: Reset Local User Password with Powershell.

you can do this with net.exe

net.exe user Administrator testpassword

Also, I think that this should work:

$tUser =
[microsoft.visualbasic.interaction]::GetObject("WinNT://./testAccount,user",$null)
$im = [reflection.bindingflags]::invokemethod
$valtype = $tUser.gettype()
$valtype.invokemember("SetPassword",$im,$null,$tUser,"Z@zzyB0y")
$valtype.invokemember("SetInfo",$im,$null,$tUser,$null)


--
--
James Truher [MSFT]
Windows PowerShell Program Management
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.

"Brandon Shell" <tshell.mask@gmail.com> wrote in message
news:%23P0PbvM4GHA.3840@TK2MSFTNGP06.phx.gbl...
>I would like the powershell equivalent of:
> -------------------------------------------
> sComputer = "MyComputer"
> Set oUser = GetObject("WinNT://" & sComputer & "/Administrator, user")
> oUser.SetPassword "testpassword"
> oUser.SetInfo
>
>



My System SpecsSystem Spec