Listing computer accounts in a non AD domain with WMI/VBS?

Discussion in 'Scripting' started by Greg Olsen, Jul 9, 2003.

  1. Greg Olsen

    Greg Olsen Guest

    What I did to get the names of all the computers in a
    domain is to parse the DOS net view command. This gets a
    list of all active computers in the domain at that time.
    You can also use something like this:
    'Use the WinNT Directory Services
    strDomain = "WinNT://" & strDomain

    'Create the Domain object
    Set TheDomain = GetObject(strDomain)

    'Search for Computers in the Domain
    TheDomain.Filter = Array("Computer")
    row = 2
    For Each Computer In TheDomain
    cName = Computer.Name
    wscript.echo cname

    but that will return all prior computer names that still
    reside on a wins server.
    Once you have all the names of the computers, you can just
    query each one with a for loop.
    Greg Olsen, Jul 9, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.