Dit is mijn hoekje op het www.
Had een of andere onverlaat onder het pseudoniem KAREEM mijn website toch zomaar gehacked!! Ik heb het weer teruggezet. Maar
The query thats checks if all network adapters and their connected-state
1 2 3 4 5 6 7 8 9 10 |
$A = Foreach ($row in (Get-WmiObject -Namespace "root/WMI" -Query "SELECT * FROM MSNdis_PhysicalMediumType")) { [pscustomobject]@{ Name = $row.InstanceName NDIS = $row.NdisPhysicalMediumType ACT = (get-wmiobject -Namespace "root/cimv2" -Query "Select * from win32_networkadapter") | Where-Object {$_.Name -eq $row.InstanceName} | Select-Object -ExpandProperty NetEnabled } } ($A | Where-Object {$_.NDIS -eq 0 -and $_.ACT -eq $true}) -ne $null |
$A gives a object with all adapters, their type
When you have a virtual machine it also has a virtual HDD.
In the old days I maintained a local folder on my disk with usefull codesnippets. No more! I’ll post them online.