I’m working on a script which I’m trying to determine the IP Address based on matching the gateway IP. I want to gather info for an IP Scan I’m planning to use in my script but in cases which the computer has multiple IP addresses I need to capture the correct one. In most cases there is only one gateway so wanting to use this as my measure to get the correct IP.
Any suggestions of code?
Also a side note any suggestions on best way to obtain IP range of a subnet based on IP address using PowerShell?