Re: change local admin password on remote computers
- From: "JC van Paassen" <info@<nospam>customscripiting.nl>
- Date: Tue, 28 Feb 2006 23:01:55 +0100
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
.
- References:
- change local admin password on remote computers
- From: Eric Payne
- change local admin password on remote computers
- Prev by Date: Re: modifying "name" attribute in AD.
- Next by Date: Re: Running VBSCript from command line versus Explorer
- Previous by thread: change local admin password on remote computers
- Next by thread: Can't run the create text file method of the file system object on local testing system
- Index(es):
Relevant Pages
|
Loading