troubleshooting Question

Powershell - NetworkInfos - Expanded Properties Filter

Avatar of Lionstone
Lionstone asked on
6 Comments2 Solutions148 ViewsLast Modified:
With powershell at the end I'd like to have a value like
Adapter, IPv4Address, MAC Address

I've got know the idea to get that with:
Get-WmiObject -ComputerName $Computer Win32_NetworkAdapterConfiguration
Wich will give me multiple unneeded adapters. So I'd like to filter these on the ones which have at least one addresses.
Get-WmiObject -ComputerName $Computer Win32_NetworkAdapterConfiguration | Where-Object { $_.IPAddress -ne $null }
And now I've got it mostly correct but I have entries like that:
DHCPEnabled      : True
IPAddress        : {, fe80::30e7:9436:7ca:136c}
DefaultIPGateway : 
DNSDomain        : 
ServiceName      : VMSMP
Description      : Hyper-V Virtual Ethernet Adapter
Index            : 5

DHCPEnabled      : True
IPAddress        : {, fe80::4889:c466:5428:5068}
DefaultIPGateway : {}
DNSDomain        :
ServiceName      : VMSMP
Description      : Hyper-V-Adapter - virtuelles Ethernet #2
Index            : 6
So I'd like to filter the unwanted 169 configured adapter. Because with this way I think I'm able to find and list all valid configured adapters (LAN, Wifi, USB Connected Adapter) in different networks or
Get-WmiObject -ComputerName $Computer Win32_NetworkAdapterConfiguration | Where-Object { $_.IPAddress -notlike "*169.254*" }
But this doesn't work, because notlike seems not working on an array.
Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros