Internal IP addresses

Discussion in 'Software' started by mbmadiw, Sep 21, 2006.

  1. mbmadiw

    mbmadiw Corporal

    It's been a long time since I've used command line. Is there a command to see all internal ip addresses on a network? If I'm wrong about that, can you suggest an alternative?

    I'd like to prevent having to go to each computer using ipconfig individually.

    Thanks!
     
  2. theefool

    theefool Geekified

    Do you have a list of the computer names?

    If not, then use:

    net view /domain:your_domain_name > computers.txt

    This will create a file of all the computers on your domain. (if you have a domain).

    Then you can write a simple batch file with the "for" statement to call the file computers.txt with the ping command, to get all the ip's.

    If you need help, either I or someone else here can write this out for ye. :)
     
  3. theefool

    theefool Geekified

    So, the bat file could be something like this:

    @echo off
    net view /domain:your_domain_name > c:\computers.txt
    for /F "eol=; tokens=1" %%i in (computers.txt) do ping %%i >> c:\ping_results.txt
    del c:\computers.txt
    notepad c:\ping_results.txt
    exit

    You could even parse the results, with more "for" statements or other commands.

    The "for" command is very powerful, and not used all that often. I love the command.
     
  4. mbmadiw

    mbmadiw Corporal

    Thanks for taking the time to do that for me. I will try to test it out tomorrow or Monday at work.

    THANKS!
     
  5. theefool

    theefool Geekified

    Didn't take that much time, since I was already familiar with it.

    Please note, you may need to change it a bit, pending on what windows OS you have at work.

    The "for" and the "net" command didn't look that different, from what I was use to, but I tested something close, with my home vista rc1 box, that I'm using right now.

    If it doesn't work, please post any errors here. :)
     
  6. theefool

    theefool Geekified

    To speed it up a bit, use this line instead:

    for /F "eol=; tokens=1" %%i in (computers.txt) do ping -n 1 %%i >> c:\ping_results.txt

    Note #143: Pending on how many clients you have, this may take a LOOONG time to run.

    Also, if it is a large file, notepad may not be able to handle it, so wordpad or winword may be a better choice.
     
  7. mbmadiw

    mbmadiw Corporal

    It ran the .bat file, but I'm doing something wrong. Let me give you a little more info. Peer to peer network of six computers, no server. All running Windows XP. Linksys router, Netgear switch. Thanks!

    Here's what the ping_results file said:



    Ping request could not find host Server. Please check the name and try again.

    Bad option -------------------------------------------------------------------------------.





    Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]

    [-r count] [-s count] [[-j host-list] | [-k host-list]]

    [-w timeout] target_name



    Options:

    -t Ping the specified host until stopped.

    To see statistics and continue - type Control-Break;

    To stop - type Control-C.

    -a Resolve addresses to hostnames.

    -n count Number of echo requests to send.

    -l size Send buffer size.

    -f Set Don't Fragment flag in packet.

    -i TTL Time To Live.

    -v TOS Type Of Service.

    -r count Record route for count hops.

    -s count Timestamp for count hops.

    -j host-list Loose source route along host-list.

    -k host-list Strict source route along host-list.

    -w timeout Timeout in milliseconds to wait for each reply.



    Ping request could not find host \\ACCOUNTING1. Please check the name and try again.

    Ping request could not find host \\ADMINLIASION. Please check the name and try again.

    Ping request could not find host Server. Please check the name and try again.

    Bad option -------------------------------------------------------------------------------.





    Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]

    [-r count] [-s count] [[-j host-list] | [-k host-list]]

    [-w timeout] target_name



    Options:

    -t Ping the specified host until stopped.

    To see statistics and continue - type Control-Break;

    To stop - type Control-C.

    -a Resolve addresses to hostnames.

    -n count Number of echo requests to send.

    -l size Send buffer size.

    -f Set Don't Fragment flag in packet.

    -i TTL Time To Live.

    -v TOS Type Of Service.

    -r count Record route for count hops.

    -s count Timestamp for count hops.

    -j host-list Loose source route along host-list.

    -k host-list Strict source route along host-list.

    -w timeout Timeout in milliseconds to wait for each reply.



    Ping request could not find host \\ACCOUNTING1. Please check the name and try again.

    Ping request could not find host \\ADMINLIASION. Please check the name and try again.

    Ping request could not find host \\ADMINTECH. Please check the name and try again.

    Ping request could not find host \\MARKETTECH. Please check the name and try again.

    Ping request could not find host \\MELISSA. Please check the name and try again.

    Ping request could not find host The. Please check the name and try again.
     
  8. theefool

    theefool Geekified

    Okay, sounds like ya may want to manually edit out the \\ makrs in the text file that it creates. sorry. :)

    Maybe this will work:

    for /F "eol=; tokens=1 delims=\\" %%i in (computers.txt) do ping %%i >> c:\ping_results.txt

    What are the results of the computers.txt file?
     
  9. theefool

    theefool Geekified

    Better yet, what is the result of this:

    net view /domain:your_domain_name
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds