|
-
Dec 6th, 2000, 07:06 PM
#1
Thread Starter
Lively Member
How can I retreive a list of all the clients on a given domain? (either by name or ip)
-
Dec 7th, 2000, 06:54 AM
#2
Lively Member
This might help
First of all download and install ADSI from
http://www.microsoft.com/ntworkstati...6redirect%3Dno
Then try this code as a VBScript
Code:
Set WshNetwork = CreateObject("WScript.Network")
Set WshGroups = CreateObject("Scripting.Dictionary")
WshGroups.CompareMode=vbTextCompare
DomName = WshNetwork.UserDomain
msgbox "Domain Name = " & DomName
Set DomComp = GetObject("WinNT://" & WshNetwork) ' DomName
DomComp.filter = Array("computer")
For each Computer in DomComp
msgbox Computer.Name
Set ComputerLogon = GetObject("WinNT://" & DomName & "/" & Computer.Name)
ComputerLogon.filter = Array("user")
For each User in ComputerLogon
msgbox Computer.Name & "-" & User.Name
Next
Next
Hope this helps
Ian Frawley
Software Engineer
E-mail [email protected]
BEING IN THERAPY
And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.
-
Dec 7th, 2000, 06:56 AM
#3
Lively Member
Sorry I made a mistake use this code
Code:
Set WshNetwork = CreateObject("WScript.Network")
Set WshGroups = CreateObject("Scripting.Dictionary")
WshGroups.CompareMode=vbTextCompare
DomName = WshNetwork.UserDomain
msgbox "Domain Name = " & DomName
Set DomComp = GetObject("WinNT://" & DomName) '
DomComp.filter = Array("computer")
For each Computer in DomComp
msgbox Computer.Name
Set ComputerLogon = GetObject("WinNT://" & DomName & "/" & Computer.Name)
ComputerLogon.filter = Array("user")
For each User in ComputerLogon
msgbox Computer.Name & "-" & User.Name
Next
Next
Regards
Ian Frawley
Software Engineer
E-mail [email protected]
BEING IN THERAPY
And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|