views:

20

answers:

1

I'm working under a domain, and im making an app that changes ip from 1 to 253 until it finds an available, unconfliced ip (where it get's ping response from the domain, it tries to ping it each time it changes ip), this part works. the problem is, that i dont want the program to override an ip address that is used by other computers that are simply shut down, and thats why it didnt conflict them in the previous process.

so my question basicly is,

how do i find out if the ip i just changed to is used by another computer in my domain? (computer is probably shutdown or else it would be confliced)

weird question & task, i know.

I don't mind using an external cmd tool, streaming the output to my code, as long as it's built-in windows.

A: 

If your computers get their ips by DHCP, you could check the DHCP leases. Otherwise maybe you can get some information from the Active Directory, but I'm not sure it stores the IP within the computer account.

hoang
I'm not allowed to use dhcp over here. about the other option, it might have been good actualy if the active directory kept ip addresses. unforutnatly it doesn't.
Alon Amir
DHCP Leases is the solution.
Alon Amir