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.
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”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.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.