Results 1 to 3 of 3

Thread: NT Clients

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Cincinnati, OH
    Posts
    66

    Unhappy

    How can I retreive a list of all the clients on a given domain? (either by name or ip)

  2. #2
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    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.

  3. #3
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    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
  •  



Click Here to Expand Forum to Full Width