bsharath
asked on
Local Admin password change script gives and network error.
Hi,
Local Admin password change script gives and network error.
Can any one add the error check options for
no permission
Timedout
or any other issue it has to log that and proceed.
Regards
Sharath
Local Admin password change script gives and network error.
Can any one add the error check options for
no permission
Timedout
or any other issue it has to log that and proceed.
Regards
Sharath
Const ForAppending = 8
Const ForReading = 1
Set fso=CreateObject("Scripting.FileSystemObject")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("C:\pass_changed.txt")
Set objNetwork = CreateObject("Wscript.Network")
Set objFile=fso.OpenTextFile("C:\computers.txt", ForReading)
Do Until objFile.atEndofStream
strComputer = objFile.ReadLine
Set objUser = GetObject("WinNT://" & strComputer & "/administrator")
intPasswordAge = objUser.PasswordAge
intPasswordAge = intPasswordAge * -1
dtmChangeDate = DateAdd("s", intPasswordAge, Now)
objTextFile.WriteLine "Password for " & strComputer & " was last changed: " & dtmChangeDate
Loop
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
https://www.experts-exchange.com/questions/24143773/Find-the-local-Administrator-password-changed-date-Script-is-not-acurate.html