I have a script that lists the computers in a Group and writes them to a text file.
I would like another sub routine that reads the text file and populates a second text file with the currently logged on users of those computers.
Please could you help.
Sub GETGROUPMEMBERS ()
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(StrComputerGroupFile, ForAppending, True)
objFile.WriteLine "Least Updated" & " " & Now
Set objGroup = GetObject(StrGroupName)
arrMemberOf = objGroup.GetEx("member")
For Each strMember in arrMemberOf
Set oObject = GetObject("LDAP://" & strMember)
If LCase(oObject.Class) = "user" Then
ElseIf LCase(oObject.Class) = "computer" Then
objFile.WriteLine Left(oObject.sAMAccountName, Len(oObject.sAMAccountName) - 1)
Set objFSO = Nothing
Set objFile = Nothing
Set objGroup = Nothing