Re: Resetting Machine's Local Password

From: Wayne Tilton (Wayne_Tilton_at_NoSpam.Yahoo.com)
Date: 09/03/04


Date: Fri, 03 Sep 2004 13:29:51 -0700


"JP Martinez" <pierre@perutek.com> wrote in
news:OKAaGQekEHA.2588@TK2MSFTNGP12.phx.gbl:

> Hi, I would like to be able to reset the administrator password in
> workstations and file servers. Is there a way or could someone point
> me to a sample on how to do this. Even if the passwords(new and old)
> are hardcoded in the code it is ok .
>
> I would like for this script to be able to go at some remote file
> servers and/or workstation and reset this
>
> Any help will be appreciated.
> -Pierre
>
>
>

How 'bout something like this:

On Error Resume Next
Set UserObj = GetObject("WinNT://WTILTONW1/TestUser")
UserObj.ChangePassword "blahblah", "bleablea"
UserObj.SetInfo
Set UserObj = Nothing
If err.number = 0 Then
   WScript.Echo "Password Change Failed"
Else
   WScript.Echo "Password Change Was Successful"
End if

Wayne

-- 
Standard Disclaimer: I said it, they didn't, so blame me, not them!
Spam Avoidance: My reply address is invalid to confuse the spambots.
You can reach me at 'Wayne_Tilton at yahoo dot com'


Relevant Pages

  • comments on my plan
    ... I wish I had discovered this user group a month ago. ... Migrate a couple test workstations. ... Migrate ever more important file servers, ... can access data on them. ...
    (microsoft.public.windows.server.migration)
  • Re: SMS Query - size of "My Documents" folder
    ... the total size of all the workstations' "My Documents" folders in a ... solution because we might not have enough disk space on our file servers ... advertisement that runs this vbscript on every workstation. ...
    (microsoft.public.sms.misc)
  • Resetting Machines Local Password
    ... I would like to be able to reset the administrator password in ... workstations and file servers. ... I would like for this script to be able to go at some remote file servers ... and/or workstation and reset this ...
    (microsoft.public.scripting.vbscript)

Loading