Change local admin PW

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Stev379 (anonymous_at_discussions.microsoft.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 08:00:58 -0700

We need to email a script to some teleworkers to change
the local administrator password and give them a pop-up
for Success or Failure. How can error checking be enabled
to handle this? The script below is the only way I've been
able to get the password (newpassword) to successfully
change. I just need some error handling and I haven't got
the expertise down for that yet.
----------------
strComputer = "."
Set CPU = GetObject("WinNT://" & strComputer & ",Computer")
Set objuser = CPU.GetObject("User", "Administrator")
dim wsh
Set wsh = Wscript.CreateObject("Wscript.Shell")
objUser.SetPassword "newpassword"
objUser.SetInfo
-----------------------

Thanks for any help!
-Steve



Relevant Pages

  • Re: Change local admin PW
    ... > the local administrator password and give them a pop-up ... > for Success or Failure. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windows.server.scripting)
  • Re: Return value of whenever sqlerror
    ... I am executing a unic script whihc in turn executes an Oracle stored ... I am failing the stored proc and using whenever sqlerror in the ... unix script to trap success. ... of my unix directory on failure and on success the PL/SQL procedure ...
    (comp.databases.oracle.server)
  • Re: ping computer and remove from AD
    ... leave it alone or 2. ... Wscript.Echo "Success pinging " & strComputer ... Case 0 PingStatus = "Success" ... In your script, where you use the NetBIOS name of the computer, you would ...
    (microsoft.public.scripting.vbscript)
  • Re: What permission(s) am I missing?
    ... of without success. ... > For the most part it doesn't matter which OS you're running the script on, ... > changed the permissions from the defaults on the remote computer. ... >> Administrators group missing and where can I change it? ...
    (microsoft.public.scripting.vbscript)
  • Re: Simple Group By, well it should be
    ... I am doing some analysis on the sysjobs and ... if all steps are a Success then the job is a Success ... To add insult to injury I cannot run this using temp tables, ... script in to Excel that doesn't like temp tables. ...
    (microsoft.public.sqlserver.programming)