Introduction
Maintenance your network workstation PC's. Changing Administrator Password to all your PC's Workstation with just one click.
Background
I was work as Engineer DSI Project. Job desc to do is migration all pc's workstation. I have some problem when i have finish this project for reporting data. When i must have to get all the data from all workstation pc's my script can't run as i want it. Then to solve this problem is to changing all PC's workstation with the same remote pc i have use it. When administrator password is different my report can't work. Then i create this script for solving my problem. It's work for me :)
Using the code
Use this code, Check the algorithm you want if you want to modified it :
On Error Resume Next
Const ForReading = 1
Set objDialog = CreateObject("SAFRCFileDlg.FileSave")
objDialog.FileName = "LogDataAcho.txt"
objDialog.FileType = "Normal Text File (*.txt)"
intReturn = objDialog.OpenFileSaveDlg
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(objDialog.FileName)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("IP-List.acho", ForReading)
strNextLine = objTextFile.ReadAll
arrComputers = Split(strNextLine, vbCrLf)
REM arrComputers = Array(_
REM "169.179.205.192",_
REM "169.179.204.112"_
REM )
For Each strComputer In arrComputers
WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="
Call achoping(strComputer)
Set user = GetObject("WinNT://" & strComputer & "/Administrator,user")
user.setpassword "Password_Here"
user.setinfo
Next
Function achoping(compinya)
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select * from Win32_PingStatus where address = '"_
& compinya & "'")
For Each objStatus in objPing
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then
WScript.Echo("Computer " & compinya & " is not reachable!! Kena ngidupin deh!!")
MsgBox "Computer IP : " & compinya & " Anjrit Mati!!Kena ngidupin deh!!Catet Tro.."
objFile.WriteLine compinya
Else
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>1 Then
WScript.Echo("Computer " & compinya & " is Available!!")
End If
End If
Next
End Function
It's work fine for me.... If u have different password for target ip host you need to chang your pc's manualy as same as host do u want it to change..
Points of Interest
I think when my work is going simple and finish it as well. This is my enough satisfaction..
History
Use it for free....