Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am on Windows XP and would like to enumerate the computers that exist on my network from a command line. I would like to enumerate them such that I can use the host names in another command, pslist . I suspect that I can use PowerShell and the "net view" command to do this, but can't iron out the specifics.

share|improve this question
Are these domain or standalone computers? – Izzy Jul 2 '09 at 2:56
Can they be read from Active Directory? I have a PS script that gets the list from AD. – Bratch Jul 2 '09 at 3:02
up vote 3 down vote accepted

The formatting in "net view" is pretty crappy for parsing since it displays NetBIOS names and they can contain spaces. (Why anyone would actually use spaces is beyond me, though...)

If you're sure your computer names don't have spaces, do:

@echo off
for /f "usebackq delims= " %%i in (`net view ^| find "\\"`) do echo %%i

Obviously, substitute a call to another batch file or a command for the "echo".

share|improve this answer
This was exactly what I was looking for. Thank you. – Sipp Jul 2 '09 at 18:51

There are many ways to enumerate systems; in fact I have a whole wiki page devoted to just this.

But one pretty nice way is with nbtscan, which will give you a list like this:

C:\> nbtscan     MTNDEW\WINDEV               SHARING DC     MTNDEW\TESTING     MTNDEW\WIZ                  SHARING U=STEVE    MTNDEW\XPDEV                SHARING
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.