2
1
Is there some way in PowerShell to automatically determine which of multiple NICs has Internet access rather than an connection to a closed network?
Say, a computer has one NIC that can generally get out to the Web and another NIC that is connected to a small, scientific device network. They both have IP addresses and see a "network". Is there a generic way to determine which is Internet connected?
I know about:
gwmi win32_networkadapterconfiguration -filter "ipenabled = 'true'"
and
gwmi win32_networkadapter -filter "NetConnectionStatus LIKE '2'"
and
Get-NetAdapter | ? {($_.status -eq 'up')
but it's not clear to me that those filters are identifying Internet access vs just network access, and unfortunately, I don't have access to a machine with that kind of setup to test.
Thanks.
I didn't realize
test-connection
had a-source
option. That is exactly what I was looking for! Unfortunately,-source
and-quiet
cannot both be used. – Teknowledgist – 2017-11-03T16:36:15.443