Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - HowTo: Reset Local User Password with Powershell.

Reply
 
Old 09-25-2006   #1 (permalink)
Brandon Shell
Guest


 
 

HowTo: Reset Local User Password with Powershell.

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
Old 09-25-2006   #2 (permalink)
James Truher
Guest


 
 

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
Reply

Thread Tools


Similar Threads
Thread Forum
Reset User Account Password Tutorials
Brink pls help....wireless not working..no internet signal after user reset password Network & Sharing
Changing password for a local user on a remote computer.... PowerShell
How do I reset the email address user name and password $ windows Vista mail
RE: Reset or Remove a User account password under a second partition/d Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46