BrianSDG
asked on
How do I test to see if a NIC is enabled or disabled with a powershell script?
How do I test to see if a NIC is enabled or disabled with a powershell script? Any ping type solutions like Test-Connection will not work. The script has to be able to ascertain that property from the NIC. Or use some algorithm that doesn't require any knowledge of anything outside the servers own system.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Well it all depends on what you're looking for :)
get-wmiobject win32_networkadapter -Filter "NetEnabled='$true'"
This will find network adapters which are disabled (that is, a disabled device in Windows by right clicking the adapter and disabling/enabling it).
Get-wmiobject Win32_NetworkAdapterConfig uration -Filter "IPEnabled='$True'"
This will look for network adapters which do not have IPv4 or IPv6 protocols in use.
get-wmiobject win32_networkadapter -Filter "NetEnabled='$true'"
This will find network adapters which are disabled (that is, a disabled device in Windows by right clicking the adapter and disabling/enabling it).
Get-wmiobject Win32_NetworkAdapterConfig
This will look for network adapters which do not have IPv4 or IPv6 protocols in use.
ASKER
Get-wmiobject Win32_NetworkAdapterConfig