thread329-1471433
I'm having any issue with this script. I added a list.txt to read from and also a scriptlog.txt to output the results.
The problem I'm having is the same info shows for all workstations. Also, what is the attribute for "last password set" (when was the password last changed)?
Any help would be greatly appreciated...
Here is what I have so far:
I'm having any issue with this script. I added a list.txt to read from and also a scriptlog.txt to output the results.
The problem I'm having is the same info shows for all workstations. Also, what is the attribute for "last password set" (when was the password last changed)?
Any help would be greatly appreciated...
Here is what I have so far:
Code:
On Error Resume Next
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTextStream = oFSO.OpenTextFile("list.txt")
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
oTextStream.Close
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("ScriptLog.txt")
For Each strComputer In RemotePC
Dim objNetwork : Set objNetwork = CreateObject("WScript.Network")
Dim objGroup : Set objGroup = GetObject("WinNT://.")
objGroup.Filter = Array("user")
Dim objUser
For Each objUser In objGroup
On Error Resume Next
objFile.WriteLine strComputer & "," & objUser.name & "," & GetObject(objUser.adsPath).LastLogin
On Error GoTo 0
Next
Next