Solved

How do I test to see if a NIC is enabled or disabled with a powershell script?

Posted on 2010-09-18
3
769 Views
Last Modified: 2012-05-10
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.

0
Comment
Question by:BrianSDG
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Learnctx earned 500 total points
ID: 33709835
I'm assuming you're running this locally on the device? If so.
get-wmiobject win32_networkadapter -Filter "NetEnabled='$true'"

Open in new window

0
 

Author Closing Comment

by:BrianSDG
ID: 33710063
thanks, you were close.  Try;
Get-wmiobject Win32_NetworkAdapterConfiguration -Filter "IPEnabled='$True'"

0
 
LVL 16

Expert Comment

by:Learnctx
ID: 33710410
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_NetworkAdapterConfiguration -Filter "IPEnabled='$True'"

This will look for network adapters which do not have IPv4 or IPv6 protocols in use.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now