[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 985
  • Last Modified:

Find open IP in IP Range

Where I work we add new computers to the domain and for a unique computer name we use the last octet of the IP as the last three digits in the computer name. We have different IP ranges for each department. Unfortunately, not much documentation is kept so there is no way of telling which IP is open in any particular range. The lack of documentation makes it extremely difficult to say the least. I'm trying to document the Computer names and IP addresses of the IP ranges I administer so there won't be any IP or AD conflicts. It's busting my rear end but it will save me headaches in the future. I had a former coworker (who I have lost contact) show me how to scan a range of IPs on the network from the CMD line to see which are being used. Using that and looking at my OU in AD I can deduce what IP is open that I can use for a new system I want to put on the network. I had written down the command but I cannot find it. I tore apart my desk at work and home and googled for hours but still have not found anything. If someone can help me out I would really appreciate anything, please. Thanks.

Please keep in mind I cannot use any type of port scanner or third party program on my network.

I really think it was one of these:

nbtstat
nslookup
netsh

Thanks for any assistance you can provide.
0
RfromP
Asked:
RfromP
3 Solutions
 
mattyfonzCommented:
is there any particular reason why you name machines like that? because im sorry to say that is a horrible way to manage computer IPs on the network what happens if the client machine get a different IP address from DHCP? or you change IP ranges for a department?. You mentioned its a domain so im assuming you have DHCP on the server which hands out IP addresses to machines connected to the network. why dont you just open up the DHCP console click on the the DHCP server in the list and look under the address leases tab for spare addresses.
Still, i strongly recommend you change the current way of naming machines, it will cause you massive headaches and overhead in the long run.
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Question - why aren't you using DHCP?  Maintaining static IPs can be difficult - Also, why can't you check DNS?

Any command line tool will not give a reliable answer because the machines MAY be off or have a firewall... thus it's better to use DHCP or DNS to look up this information.

Now, that said, you can find out which addresses are in use using the command line and a small batch file.  For example, assuming your network range is 192.168.2.50 through 192.168.2.70, you would execute the following command:

for /l %a in (50,1,70) do @ping -n 1 -w 100 192.168.2.%a | find /i "reply"

To break it down, we are saying to loop - (50,1,70) means (start at 50, increment by 1, end at 70) do the ping command, sending one packet (n 1), waiting 100 ms (.1 seconds, -w 100), to the IP address 192.168.2.x, where x is filled in automatically with the numbers from 50 to 70).  Then find in the output of the ping command (while ignoring case - /i) the word "reply".

0
 
_Commented:
You can try NET VIEW
with the /? after it, you can get a couple of  switches if you need them
0
Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

 
Kamran ArshadCommented:
Hi,

Try out AngryIP Scanner;

www.angryziber.com
0
 
Johneil1Commented:
Try this!!!!

Open Command Prompt and type:

FOR /L %i IN (1,1,254) DO ping -n 1 192.168.0.%i | FIND /i "Reply">>c:\ipaddresses.txt

The "-n 1" is for only 1 ping packet to be sent to each computer.

Change 192.168.0 to match you own Network ID.

This will ping all IP addresses on the 192.168.0.0 network segment and create a text file called IPADDRESSES.TXT in C:\, where it will list only the IP addresses that gave a reply.

You can also add a -a to the PING command to resolve all the responding IP addresses to HOST names, but doing so will cause the script to take a considerable time to finish:

FOR /L %i IN (1,1,254) DO ping -a -n 1 192.168.0.%i | FIND /i "Reply">>c:\ipaddresses.txt

don't forget to type the command in 1 line.
0
 
RfromPAuthor Commented:
To mattyfonz:

No where in your post did you offer up a solution, only criticism. I don't own the network so I can only play the hand I'm dealt and I was looking for a solution to my problem, not a critique of the way the network is managed.

To uetian1707:

I don't know what qualifies you as a "Guru" if you can't comprehend what I clearly stated in my question which is that I cannot use any port scanner or third party program on my network.
 
 Thanks to leew, coral47, and Johneil1 for offering real help instead of criticism and a flippant recommendation.
0
 
_Commented:
Thank you much.   : )
0
 
mattyfonzCommented:
"open up the DHCP console click on the the DHCP server in the list and look under the address leases tab for spare addresses"
That was the solution i suggested, i wasnt criticizing you just pointing out that the current way of doing things is quite difficult. also if your the administrator of the network now then you do in fact own it in the sense that you can generally make improvements as you see fit. But each to their own, good luck with it all.
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now