Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Need help with passwd change script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,65005
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Need help with passwd change script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Need help with passwd change script - 10/13/2008 1:36:33 AM   
  AlucarD

 

Posts: 2
Score: 0
Joined: 10/13/2008
Status: offline
Original message moved by dm_4ever
Reason : Moving to appropriate forum
Hello All!
I need help with my script.
It change password for admin on remote host.
I want to that script ask me for old passwd and then ask me for new passwd and open txt file with list of ip address and do sCommand for every line in that file.
Sorry for my english and thanks a lot for help.

This is the code i wrote.

Option Explicit

Const MyApp = "Passwd Change"
Const Netsend = "C:\psexec.exe"
Const WindowStyle = 0
Const WaitOnReturn = False

Dim sCommand, sSendto, sOldpasswd, sPasswd
Dim oSh

On Error Resume Next

If Not IsWinnt() Then
WScript.Echo "Run this script under Windows NT 4.0 or higher"
WScript.Quit(1)
End If

sOldpasswd = InputBox("Type Old Admin Passwd", MyApp)
If sOldpasswd = "" Then WScript.Quit(1)

sPasswd = InputBox("Type New Admin Passwd", MyApp)
If sPasswd = "" Then WScript.Quit(1)

sSendto = InputBox("Type Host IP Adress", MyApp)
If sSendto = "" Then WScript.Quit(1)

sCommand = Netsend & " \\" & sSendto & " -u administrator" & " -p " & sOldpasswd & " net user administrator" & " " &

sPasswd


Set oSh = CreateObject("WScript.Shell")
oSh.Run sCommand, WindowStyle, WaitOnReturn
Set oSh = Nothing


Private Function IsWinnt()

Const OSNT = "Windows_NT"
Dim oSh
Dim sOS

IsWinnt = False

Set oSh = CreateObject("WScript.Shell")
sOS = oSh.ExpandEnvironmentStrings("%OS%")
Set oSh = Nothing

If sOS = OSNT Then IsWinnt = True

End Function
 
 
Post #: 1
 
 RE: Need help with passwd change script - 10/13/2008 4:28:12 AM   
  dm_4ever


Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
So you just want to change the admin password on a remote machine?  Do you have access to that machine without having to specify the old login?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to AlucarD)
 
 
Post #: 2
 
 RE: Need help with passwd change script - 10/13/2008 7:12:43 AM   
  AlucarD

 

Posts: 2
Score: 0
Joined: 10/13/2008
Status: offline
No i don't have it.
I must do it in that way and for psexec this pass is required.

(in reply to dm_4ever)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Need help with passwd change script Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts