Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Get IP of the first NIC on a server

$
0
0

All servers have Private static IP and I'm trying to get the IP of the first NIC in the binding order withing the range of 10.0.0.0 - 10.255.255.255

        $IP = Get-WmiObject win32_networkadapterconfiguration -ComputerName $server | where {$_.IPAddress -match "10"}
        $IP.IPAddress[0] | Out-File -Append $IPAddresslist

For some reason this code outputs IP's on few server that are public and not from the first NIC in the binding order. Please help.


99upgrade


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>