digital8 Second Lieutenant
Joined: 29 Sep 2005
Posts: 1002
|
Posted: Fri Oct 07, 2005 11:23 am Post subject: Remote Enumeration of Localgroups |
|
|
I am looking for a way to remotely enumerate membership of localgroups. I have been successful in getting the group names via WMI but not the members. Can anybody point me in the right direction?
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Dim GroupString
Dim WorkStation
GroupString = "<local group>"
WorkStation = "<machine name>"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(AdminLog, ForAppending, True)
f.WriteLine(Workstation)
Set GroupObj = GetObject("WinNT://" & Workstation & "/" & GroupString)
For each UserObj in GroupObj.Members
f.WriteLine(" " & UserObj.AdsPath)
Next
f.Close |
|