PowerShell Get-NetAdapter
!powershell-get-netadapter
The Get-NetAdapter cmdlet in PowerShell is used to get the basic network adapter properties. It returns visible adapters by default.
The Get-NetAdapter cmdlet retrieves common adapter properties, you can use the Format-List cmdlet to see adapter properties. To see all the properties, use the Property parameter with the wildcard character ”*”.
In this article, we will discuss how to use Get-NetAdapter to get all visible network adapters, and hidden adapters, retrieve all physical network adapters, get a network adapter specified by the name, display common properties for network adapter, and display all properties for the specified network adapter.
What is the Syntax of Get-NetAdapter
The Get-NetAdapter cmdlet syntax is given below.
Get-NetAdapter
-InterfaceIndex <UInt32[]>
-InterfaceDescription <String[]>
[[-Name] <String[]>]
[-IncludeHidden]
[-Physical]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[<CommonParameters>]
How to Get All Visible Network Adapters
To get all visible network adapters in the system, use the Get-NetAdapter cmdlet in PowerShell.
Get-NetAdapter -Name *
In the above PowerShell script, the Get-NetAdapter cmdlet uses the -Name parameters to get and display all of the visible network adapters.
How to Get Visible and Hidden Network Adapters
You can use the Get-NetAdapter cmdlet with the -IncludeHidden parameter to retrieve visible and hidden network adapters.
Get-NetAdapter -Name * -IncludeHidden
How to Get All Physical Network Adapters
Use the Get-NetAdapter command with the -Physical parameter to get all of the physical network adapters in the system.
Get-NetAdapter -Name * -Physical
How to Get a Network Adapter by the Specified Name
To get a network adapter by the specified name, use the Get-NetAdapter command with the -Name parameter to specify the network adapter.
Get-NetAdapter -Name "Ethernet"
In the above PowerShell script, the Get-NetAdapter command gets a network adapter named “Ethernet”.
How to Display the Common Properties of the Specified Network Adapter
The Get-NetAdapter command displays the common properties of the network adapter by default. Use the -FormatList cmdlet to format the list.
Get-NetAdapter -Name "Ethernet*" | Format-List
In the above PowerShell script, the Get-NetAdapter retrieves the common properties of the specified network adapter that begins with the name “Ethernet*” and pipes them to the Format-List cmdlet to display the common properties.
The output of the above PowerShell script to display the common properties of the network adapter is:
PS C:\> Get-NetAdapter -Name "Ethernet*" | Format-List
Name : Ethernet 2
InterfaceDescription : Cisco AnyConnect Secure Mobility Client Virtual Miniport Adapter for Windows x64
InterfaceIndex : 13
MacAddress : 00-05-A3-4D-8A-00
MediaType : 802.3
PhysicalMediaType : Unspecified
InterfaceOperationalStatus : Down
AdminStatus : Down
LinkSpeed(Mbps) : 862.4
MediaConnectionState : Unknown
ConnectorPresent : False
DriverInformation : Driver Date 2019-05-01 Version 4.7.3045.0 NDIS 6.20
Name : Ethernet
InterfaceDescription : Intel(R) Ethernet Connection (4) I219-LM
InterfaceIndex : 11
MacAddress : 6C-03-CA-2B-12-58
MediaType : 802.3
PhysicalMediaType : 802.3
InterfaceOperationalStatus : Down
AdminStatus : Up
LinkSpeed(Mbps) : 0
MediaConnectionState : Disconnected
ConnectorPresent : True
DriverInformation : Driver Date 2017-12-27 Version 12.17.8.9 NDIS 6.50
How to Display All Properties for the Specified Network Adapter
To display all properties for the specified network adapter, use the following script that uses the Get-NetAdapter command with the Properties * parameter.
Get-NetAdapter -Name "Ethernet" | Format-List -Property *
Cool Tip: How to get the network adapter driver version in PowerShell!
How to Get All Network Adapters using the Interface Description
The Get-NetAdapter cmdlet in PowerShell has the -InterfaceDescription parameter. The following command gets all of the network adapters using the interface description that matches the pattern.
Get-NetAdapter -InterfaceDescription "Hyper-V*"
The output of the above PowerShell script retrieves the network adapters using the interface description that matches the prefix pattern “Hyper-V*”.
Cool Tip: How to get network adapter IP address using PowerShell!
Conclusion
I hope the above article on the Get-NetAdapter cmdlet in PowerShell to get all the visible network adapters in the system.
Related Articles
Network Adapter Information
- PowerShell Network Adapter Status - Check adapter status
- PowerShell Network IP Address - Get IP addresses
- PowerShell Network Driver Version - Get driver info
- PowerShell Network Hub - Complete network management guide
Network Configuration
- PowerShell Get-NetIPAddress - IP configuration details
- PowerShell Get-NetIPConfiguration - Network config
- PowerShell Get-NetRoute - Routing information
- PowerShell Get-DnsClient - DNS settings
Data Selection & Filtering
- PowerShell Select-Object - Select adapter properties
- PowerShell Where-Object - Filter network adapters
- PowerShell ForEach-Object - Process multiple adapters
- PowerShell Measure-Object - Calculate adapter statistics
Display & Formatting
- PowerShell Format Table - Format adapter output
- PowerShell Output Table - Create adapter tables
- PowerShell Format List - List format display
Control Flow & Logic
- PowerShell If-Else Statement - Conditional adapter logic
- PowerShell Switch Statement - Switch adapter types
- PowerShell Try-Catch - Error handling
- PowerShell For Loops - Loop through adapters
Variables & Collections
- PowerShell Variables - Store adapter data
- PowerShell Arrays - Work with adapter arrays
- PowerShell Hashtables - Store adapter configuration
- PowerShell Add-Member - Add custom adapter properties
Output & Export
- PowerShell Output to File - Export adapter data
- PowerShell Export CSV - Export to CSV format
- PowerShell Import CSV - Import adapter configuration
String Operations
- PowerShell Strings - String manipulation
- PowerShell Replace Strings - Modify adapter names
System Monitoring
- PowerShell Get-Process - Process network information
- PowerShell Get-Service - Network service status
- PowerShell Get-WmiObject - WMI network information
- PowerShell Get-CimInstance - CIM network data
Functions & Automation
- PowerShell Functions - Create network adapter functions
- PowerShell Group-Object - Group adapters by properties
- PowerShell Measure-Object - Count and analyze adapters
Comprehensive Guides
- Complete PowerShell Guide - Full PowerShell reference
- Complete PowerShell Tutorial - Comprehensive course