troubleshooting Question

Powershell - NetworkInfos - Expanded Properties Filter

Avatar of Lionstone
Lionstone asked on
Powershell
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        : {169.254.19.108, fe80::30e7:9436:7ca:136c}
DefaultIPGateway : 
DNSDomain        : 
ServiceName      : VMSMP
Description      : Hyper-V Virtual Ethernet Adapter
Index            : 5

DHCPEnabled      : True
IPAddress        : {11.11.11.11, fe80::4889:c466:5428:5068}
DefaultIPGateway : {11.11.11.3}
DNSDomain        : company.cc
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 11.11.11.0/24 or 192.168.0.0/24:
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.
ASKER CERTIFIED SOLUTION
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