View Full Version : Enumerating machines
dineshcooper
02-15-2004, 07:27 AM
Is there anyway to get a list of all machine on a network, pref. programmatically or by a command.
Any help would be greatly appreciated
<a target="_blank" href=http://www.inetcat.org/software/nbtscan.html>Nbtscan</a>
dineshcooper
02-19-2004, 04:15 PM
thanks that works.
dineshcooper
02-27-2004, 06:05 AM
Okay, i found out how to do this using vbscript and wmi.
Posting here in case anyone else was also wondering.
Dim GlobalName
Dim MyDomain
Dim oDomain
Dim strDomainName
Dim oComputer
Dim count
count = 0
Set GlobalName = GetObject("WinNT:")
For Each MyDomain in GlobalName
Wscript.Echo MyDomain.Name
Set oDomain = GetObject("WinNT://" & MyDomain.Name)
oDomain.Filter = Array("Computer")
For Each oComputer in oDomain
'** Displays each machine in the domain **
Wscript.Echo oComputer.Name
'Set objWMIService = GetObject("winmgmts:\\" & oComputer.Name & "\root\cimv2")
'Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
'Wscript.Echo "UserName: " & objItem.UserName
count = count + 1
Next
Wscript.Echo Count
Next
It looks like that script shows all the machines in a Domain
Dazeagle
02-28-2004, 05:25 AM
this vbscript got the heck out off me. it's shows one name only in a message.
i just kept clicking and clicking :(
<font color=red>If it was easy, everybody would be doing it.</font color=red>/images/forums/icons/cool.gif
dineshcooper
03-02-2004, 03:51 AM
Yeah, sorry about that, I was using that script as an example. If you run it on a large domain you're gonna crap with all the msgboxes but you could just kill the process.
Yes it displays all machines per domain.
<P ID="edit"><FONT class="small">Edited by dineshcooper on 03/02/04 03:54.</FONT></P>
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.