Quantcast
Channel: Microsoft – JeffOps
Viewing all articles
Browse latest Browse all 120

Getting information about network adapters with PowerShell

$
0
0

In PowerShell v3 we’ve got a new cmdlet: Get-NetAdapter.
So, what can we do with this?

First, what output does this cmdlet give us?

Command: Get-NetAdapter
1

So could you use the help feature in PowerShell to get a view of the possible parameters and syntax this cmdlet offers?

Command: Get-Help Get-NetAdapter
2

As you can see, there is a –IncludeHidden parameter which include any hidden network adapters in your output:

Command: Get-NetAdapter –IncludeHidden
3

But there also is a –Physical parameter which will only include physical network adapters in your output?

Command: Get-NetAdapter –Physical
4

So what if you want to get the virtual network adapters instead of the physical?
Well, there isn’t a cmdlet included for that, so you can simply filter on the property value, right?

Command: Get-NetAdapter | Where {$_.Virtual –eq $True}
5

You can also easily filter on the description by using the –InterfaceDescription parameters.
For example… let’s get all the network adapters with “Hyper-V” in the description?

Command: Get-NetAdapter –InterfaceDescription “*Hyper-V*”
6

Here is how you get some basic information about the driver which is used by the adapter

Command: Get-NetAdapter | select name, drivername, majordriverversion, minordriverversion, driverinformation
7

And to get information about the linkspeed and such?

Command: Get-NetAdapter | select vlandid, promiscuousmode, portnumber, networkaddress, permanentaddress, mediatype
8

And the last one in the category of information gathering, to get some information about the state and capabilities of the network adapter?

Command: Get-NetAdapter | select transmitlinkspeed, physicalmediatype, mediaconnectionstate, speed, requestedspeed, maxspeed, fullduplex, linkspeed

9

 

 

Post to Twitter


Viewing all articles
Browse latest Browse all 120

Trending Articles