Re: change local admin password on remote computers



But you can use locator object to connect via WMI to start a process on a
remote machine!
Start tthe script remotely on the server, let it eg. mail the results.
Or place the script on the remote machine, start it over WMI and let the
script remove itsself.


"Eric Payne" <epayne11@xxxxxxxxxxxxxxxx> schreef in bericht
news:uc00NtJPGHA.3360@xxxxxxxxxxxxxxxxxxxxxxx
I need to change a local admin password (may be different ID's) on remote
computers.
I can change the password simply enough by doing this:

ChangePassword("SERVER01","administrator",P@ssw0rd)

Function ChangePassword(strComputerName, strAdminID, strNewPassword)
Dim objUser
Set objUser = GetObject("WinNT://" & strComputerName & "/" & strAdminID
& ", User")

objUser.SetPassword strNewPassword
objUser.SetInfo

if err <> 0 then
ChangePassword = vbFalse
Else
ChangePassword = vbTrue
End if
Set objuser = Nothing
End Function
But this only works on all local domain computers and not on non
domain\non trusted domain computers (like web servers in a DMZ).

I can use the ConnectServer method of WMI to connect to the remote server
and pass in the appropriate permissions that way, but there doesn't seem
to be any WMI specific way of changing a password, so that is out.

Net use does work, I can shell out net use to servername\ipc$
/user:adminID password then call the change password function then delete
the ipc connection.
Is there any other way to do this, maybe a better way?

Thanks



.



Relevant Pages

  • RE: Does WMI have to be installed on Remote Computer?
    ... IMHO this looks like a well constructed and very vell commented script. ... WMI comes as standard on w2k w2k3 and xp, ... does WMI need to be installed on the remote computer in order for a ... ''' First try to ping the server. ...
    (microsoft.public.scripting.vbscript)
  • Does WMI have to be installed on Remote Computer?
    ... I'm new to WMI, learning as I go. ... does WMI need to be installed on the remote computer in order for a ... script which uses WMI to work? ... ''' First try to ping the server. ...
    (microsoft.public.scripting.vbscript)
  • Re: Error on 64 bit systems...
    ... Try logging on to the 64-bit system and running the script from that system against itself and against other servers. ... At this point, we're not seeing any errors that would indicate breakage in WMI or an odd configuration, so the problem is apparently rather well-hidden. ... Running the code on the 64-bit server will fill in the picture. ... If it runs ok locally but doesn't run against the remote systems, there's a symmetric problem - likely something with the credentials being used. ...
    (microsoft.public.scripting.vbscript)
  • Re: How can I kill a stuck cmd.exe remotely?
    ... sample script code... ... Microsoft MVP - Windows Server Management Infrastructure ... > the cmd would stuck for some reasons I did not know. ... > something in order to run the WMI thing? ...
    (microsoft.public.windowsxp.wmi)
  • Re: MapNetworkDrive local/remote
    ... Win32_Process.Create over WMI the script simply dies right when it was ... It dies and doesn't log the action after "net use". ... Logged to my machine using the same user as the remote machine ...
    (microsoft.public.scripting.wsh)

Loading