Need to find computer names on LAN

Hello

I have set up a domain at my house on a windows 2003 domain controller.  I have 6 other computers running XP attached to this domain controller through a cisco switch, able to ping back and forth to each pc from any pc on domain

Here is my question.  Is there a dos command that I can run on any computer that will show me the individual computer names of all the PC's attached to the domain?
scottatadtAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RPPreacherCommented:
ping -a assuming you know IP addresses.

ping -a <ip address>
scottatadtAuthor Commented:
No,

Let's pretend we know absolutely nothing about any of the other computers, as well as not know any IP Addresses included.
RPPreacherCommented:
create a loop and ping all IPs on subnet using ping -a
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

scottatadtAuthor Commented:
No,

Let's pretend we know absolutely nothing about any of the other computers, as well as not know any IP Addresses included.
RPPreacherCommented:
or net view /domain:<domain name>
scottatadtAuthor Commented:
or net view /domain:<domain name>

That doesn't work.  Already tried this with multiple combinations over and over.
sirbountyCommented:
net view
by itself should show you...works on my home domain...
scottatadtAuthor Commented:
Well unfortunately it doesn't work for  me., so do you have any more ideas?  Is there another command or sequence of commands that I can try to accomplish my goal?

From any pc, I want to be able to run a command or a few commands to determine the names of the computers on my domain.  This cannot be impossible.
RPPreacherCommented:
Then no.  There is no DOS command.  If you can't get net view to work and can't ping 6 computers, you are stuck.
RPPreacherCommented:
It's not impossible.  It's net view or ping -a, but you said that doesn't work.  So not impossible...
scottatadtAuthor Commented:
Anybody else have any suggestions?
ShmoidSenior EngineerCommented:
You said net view does not work. Do you get an error message?

Don't use any parameters just type

NET VIEW

Nothing else. Report back any error you get.
joolsSenior Systems AdministratorCommented:
try `nbtstat -n`

I think there is another command but I'm racking my brain at the moment....
sirbountyCommented:
Wait a minute - are they all joined to the domain?
ShmoidSenior EngineerCommented:
sirbounty, that's exactly what I was thinking. He says, "attached to this domain controller through a cisco switch" but doesn't mention joining the domain. That's why I asked if he was getting any error messages when issuing net view. I was betting he would get a system error 6118 or similar indicating the PC's were still in a workgroup.

jools, nbtstat -n will only show names that have been registered locally on the system by NetBIOS applications. It would not show all other PC's in the domain. If he pinged all PC's then issued nbtstat -c it would show all cached names but that defeats his purpose.
So scottatadt, any error messages?
Darr247Commented:
Do you have a WINS server setup?
joolsSenior Systems AdministratorCommented:
I was hoping there would be some more errors.

Alas the other utility I was thinking about was smbtree, I guess I was in linux mode...
scottatadtAuthor Commented:
It seems that just running net view by itself will show the computers attached to the domain.  However, I didn't mention that I was looking for the individual IP addresses of all the PC's attached to the domain as well - all of this with a command or set of commands.  I appologize for not being clear.

sirbountyCommented:
How about this...save as findPC.bat
@echo off
for /f %%a in ('net view^|find /i "\\"') do (
  set pc=%%a
  echo Locating %pc:~2%...
  for /f "tokens=3" %%r in ('ping %pc:~2% -n 1^|find /i "Pinging"') do (
    echo.  Found at %%r
  )
  echo.
)

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Darr247Commented:
Do you have a WINS server setup?
RPPreacherCommented:
>I didn't mention that I was looking for the individual IP addresses of all the PC's

You should probably open another question thread for that.  Many experts have given you MANY solutions to your question.  It's bad form to keep "extending" the question.

...oh did I mention I needed the MAC addresses too?
...oh and the currently logged on user?
...oh and the color of the mouse...
sirbountyCommented:
I don't see an extension of the question - the asker wasn't getting a resolution from the posted suggestions, and once a solution was found to be working, just asked for associative reference (this 'returned PC' is located at 'this IP address').  Not too much to ask for a 500 point question, imho.

That said, if my last posted batch file works for you, you can save the output using this modification:
@echo off
set output=c:\results.txt
if exist %output% del /q %output%
for /f %%a in ('net view^|find /i "\\"') do (
  set pc=%%a
  echo Locating %pc:~2%... >> %output%
  for /f "tokens=3" %%r in ('ping %pc:~2% -n 1^|find /i "Pinging"') do (
    echo.  Found at %%r >> %output%
  )
  echo.
)

Open in new window

scottatadtAuthor Commented:
No Wins server is setup

Sorry for extending the question RPPreacher, your right it is bad form, but you don't have to add comments like-  ...oh and the color of the mouse...  --> That is bad form as well.  Besides I did appologize.

sirbounty - I will test this out as soon as I can.  Thanks.



scottatadtAuthor Commented:
Sirbounty

I tried that but it didn't work.
sirbountyCommented:
Anything in the output?
Try it without the first line and let's see what's happening...
REM @echo off
cls
set output=c:\results.txt
if exist %output% del /q %output%
for /f %%a in ('net view^|find /i "\\"') do (
  set pc=%%a
  echo PC is %pc:~2%
pause
  echo Locating %pc:~2%... >> %output%
  for /f "tokens=3" %%r in ('ping %pc:~2% -n 1^|find /i "Pinging"') do (
    echo.  Found at %%r >> %output%
pause
  )
  echo.
)

Open in new window

scottatadtAuthor Commented:
Tried it again, and it just pops up with a DOS screen and quickly goes away.  I will keep playing around with this file to see if I can get it right.
sirbountyCommented:
Start a cmd window first - then run it...

Start->Run->cmd <Enter>

Then change to the folder where it's been saved:
  cd \ yourfolder
and run it..
  yourscript.bat
AmazingTechCommented:
sirbounty,

I think you need to use SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEDELAYEDEXPANSION
REM @echo off
cls
set output=c:\results.txt
if exist %output% del /q %output%
for /f %%a in ('net view^|find /i "\\"') do (
  set pc=%%a
  echo PC is !pc:~2!
pause
  echo Locating !pc:~2!... >> %output%
  for /f "tokens=3" %%r in ('ping !pc:~2! -n 1^|find /i "Pinging"') do (
    echo.  Found at %%r >> %output%
pause
  )
  echo.
)

Open in new window

scottatadtAuthor Commented:
Good work guys, going to wrap this one up.  I have enough information now to conclude my experiment.  I want to thank each and everyone of you for your help and patience.  
scottatadtAuthor Commented:
Thanks again!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.