CMD Simulator
Networkinggetmac

Getmac Command: Display MAC Addresses for Network Adapters | Guide

Learn how to use getmac to display physical (MAC) addresses for all network adapters, identify network interfaces, and troubleshoot network hardware.

Rojan Acharya·
Share

The getmac command displays the Media Access Control (MAC) addresses and associated network protocols for all network adapters on local or remote computers. Use getmac to view MAC addresses in simple format, getmac /v for verbose output with adapter names and connection information, and getmac /fo table for formatted table display. Add /s computername to query remote systems. Essential for MAC address filtering, network inventory, adapter identification, and troubleshooting network hardware.

Whether you're configuring MAC address filtering on routers, creating network inventory documentation, identifying which physical adapter is which, troubleshooting network connectivity issues, or verifying network adapter installation, getmac provides quick access to MAC addresses without navigating Windows settings interfaces.

This comprehensive guide covers getmac syntax, all major options (/v, /fo, /nh, /s, /u, /p), practical examples for local and remote MAC address queries, understanding output formats, troubleshooting network adapters, and frequently asked questions. By the end, you'll confidently use getmac to retrieve MAC addresses for network administration and troubleshooting tasks.

What Is Getmac?

Getmac is a built-in Windows command-line utility that retrieves and displays MAC (Media Access Control) addresses for network adapters. MAC addresses are unique 48-bit hardware identifiers assigned to network interface cards (NICs) by manufacturers, displayed as six pairs of hexadecimal digits (e.g., 00-1A-2B-3C-4D-5E). These addresses operate at the data link layer (Layer 2) of the OSI model and identify physical network interfaces on local networks.

Getmac runs in Command Prompt (CMD), PowerShell, and Windows Terminal on Windows 2000 and later, including Windows 10, Windows 11, and Windows Server editions. Unlike ipconfig which shows comprehensive network configuration including MAC addresses among other information, getmac focuses specifically on MAC addresses with optional adapter details, providing cleaner output when MAC addresses are all you need.

Syntax

getmac [/s computer [/u [domain\]user [/p password]]]
       [/fo {table | list | csv}] [/nh] [/v]

Parameters and Options

ParameterPurposeUse Case
(no parameters)Display MAC addresses for local computerQuick MAC address lookup
/vVerbose mode—show detailed adapter informationIdentify adapter names and connection status
/fo formatSpecify output format: table, list, or csvControl output formatting for scripts
/nhNo header—suppress column headers in outputCleaner output for scripting and parsing
/s computerQuery specified remote computerRemote MAC address lookup
/u domain\userRun with specified user account credentialsRemote query with different permissions
/p passwordPassword for user account (use with /u)Provide credentials for remote access

Parameters and Options Explained

Basic Getmac (No Parameters)

Displays MAC addresses for all network adapters in simple format without verbose details.

Example:

getmac

Output:

Physical Address    Transport Name
=================== ==========================================================
00-1A-2B-3C-4D-5E   \Device\Tcpip_{GUID}
00-50-56-C0-00-08   Media disconnected

Shows MAC addresses and transport names. "Media disconnected" indicates adapter with no active connection.

/v – Verbose Mode

Displays detailed information including adapter names, connection names, and network addresses.

Example:

getmac /v

Output:

Connection Name     Network Adapter                           Physical Address    Transport Name
=================== ========================================= =================== ==========================================================
Ethernet            Intel(R) Ethernet Connection              00-1A-2B-3C-4D-5E   \Device\Tcpip_{GUID}
Wi-Fi               Intel(R) Wi-Fi 6 AX201 160MHz             00-50-56-C0-00-08   Media disconnected

Provides human-readable adapter names and connection information. Most useful format for identifying adapters.

/fo format – Format Output

Specifies output format: table (default, column-aligned), list (vertical name-value pairs), or csv (comma-separated for spreadsheets).

Example:

getmac /fo list
getmac /fo csv

List format:

Connection Name:     Ethernet
Network Adapter:     Intel(R) Ethernet Connection
Physical Address:    00-1A-2B-3C-4D-5E
Transport Name:      \Device\Tcpip_{GUID}

CSV format:

"Ethernet","Intel(R) Ethernet Connection","00-1A-2B-3C-4D-5E","\Device\Tcpip_{GUID}"

CSV format ideal for importing into Excel or database; list format for detailed review.

/nh – No Header

Suppresses column headers in output. Useful for scripts that parse output or when concatenating results from multiple commands.

Example:

getmac /nh

Output (no header line):

00-1A-2B-3C-4D-5E   \Device\Tcpip_{GUID}
00-50-56-C0-00-08   Media disconnected

/s computername – Query Remote Computer

Retrieves MAC addresses from specified remote computer. Requires appropriate permissions and remote computer must allow remote queries.

Example:

getmac /s SERVER01
getmac /s 192.168.1.100

Queries computer named SERVER01 or IP 192.168.1.100. Useful for remote network inventory without physical access.

/u and /p – Specify Credentials

Provides username and password for remote computer access when current credentials insufficient.

Example:

getmac /s SERVER01 /u DOMAIN\AdminUser /p Password123

Connects to SERVER01 using specified domain credentials. Important: Avoid using /p with password on command line in production (password visible in command history); omit /p to be prompted securely.

Examples

This section covers practical getmac usage for network administration and troubleshooting.

Example 1: Quickly Find MAC Address

Scenario: Need MAC address for router MAC filtering or network documentation.

Command:

getmac

Explanation: Displays MAC addresses for all adapters. First entry typically Ethernet, second Wi-Fi if present. Copy MAC address for use in router configuration.

Example 2: View Detailed Adapter Information

Scenario: Multiple adapters present; need to identify which MAC belongs to which physical adapter.

Command:

getmac /v

Explanation: Shows connection name (Ethernet, Wi-Fi), adapter model, MAC address, and status. Easily identify which adapter is which when configuring network settings.

Example 3: Export MAC Addresses to CSV

Scenario: Creating network inventory spreadsheet for multiple computers.

Command:

getmac /v /fo csv > C:\network-inventory.csv

Explanation: Exports verbose MAC address information in CSV format to file. Open in Excel for inventory management. Append from multiple systems with >> instead of >.

Example 4: Get Clean Output for Scripting

Scenario: Batch script needs to extract just MAC addresses without headers or extra formatting.

Command:

getmac /fo csv /nh

Explanation: CSV format with no headers provides cleanest output for parsing in scripts. Each line is single adapter's data.

Example 5: Query Remote Computer's MAC Addresses

Scenario: Need MAC address from server without physical access for remote support or inventory.

Command:

getmac /s SERVER01 /v

Explanation: Retrieves verbose MAC address information from remote computer SERVER01. Requires administrative privileges on remote system and firewall allowing remote management.

Example 6: Identify Disconnected Adapters

Scenario: System has multiple adapters; need to know which are connected vs disconnected.

Command:

getmac /v

Explanation: "Media disconnected" in output indicates adapter physically disconnected or disabled. Connected adapters show transport name with device path.

Example 7: Compare with Ipconfig Output

Scenario: Verifying getmac and ipconfig show same MAC addresses (sanity check).

Commands:

getmac /v
ipconfig /all

Explanation: Compare "Physical Address" from ipconfig /all with MAC addresses from getmac /v. Should match for same adapters. Discrepancies indicate reporting issue or virtual adapter differences.

Example 8: Create Network Adapter Inventory Report

Scenario: Document all network adapters and MAC addresses for compliance or asset management.

Command:

getmac /v /fo list > C:\adapter-inventory-%COMPUTERNAME%.txt

Explanation: Creates detailed text file with adapter information in list format. Filename includes computer name for multi-system inventories. Collect from all systems for central repository.

Example 9: Query Multiple Remote Computers

Scenario: Get MAC addresses from multiple servers for network management.

Commands (in batch script):

@echo off
for %%s in (SERVER01 SERVER02 SERVER03) do (
    echo === %%s ===
    getmac /s %%s /v /fo table
    echo.
)

Explanation: Loops through server list, queries each, and displays results with server name headers. Automates multi-system inventory collection.

Example 10: Filter to Active Adapters Only

Scenario: Only interested in connected adapters, not disconnected or disabled ones.

Command:

getmac /v | findstr /V "disconnected"

Explanation: Pipes getmac output to findstr with /V (inverse match) to exclude lines containing "disconnected". Shows only active adapters. Alternative: getmac /v | findstr /V /I "media" for case-insensitive filtering.

Common Use Cases

Getmac serves network administration, security, and troubleshooting scenarios:

  • MAC Address Filtering Configuration – Routers and switches use MAC filtering for access control. Use getmac to retrieve MAC addresses for devices you want to allow or block. Essential for Wi-Fi security and network access management.

  • Network Inventory and Asset Management – Create comprehensive network adapter inventory documenting MAC addresses, adapter models, and computer associations. Critical for network documentation, asset tracking, and compliance audits.

  • Adapter Identification – Systems with multiple network adapters (Ethernet, Wi-Fi, virtual adapters) need clear identification. getmac /v shows which MAC belongs to which adapter, simplifying configuration and troubleshooting.

  • DHCP Reservation Setup – Configure DHCP servers to assign specific IP addresses to specific MAC addresses. Getmac retrieves MAC addresses needed for creating DHCP reservations ensuring devices get consistent IPs.

  • Network Troubleshooting – When connectivity issues occur, verify network adapter is recognized and has valid MAC address. "Media disconnected" status helps identify physical connectivity problems.

  • Remote System Inventory – Use getmac /s to collect MAC addresses from remote systems without physical access. Useful for remote support, network audits, and centralized inventory management.

  • Virtual vs Physical Adapter Differentiation – Virtual machines, VPNs, and containers create virtual adapters. Getmac lists all adapters helping distinguish physical from virtual based on MAC patterns (virtual often start with specific prefixes).

  • License Management – Some software licenses MAC addresses to specific hardware. Getmac retrieves MAC for license activation or verification after hardware changes.

  • Security Auditing – Identify all network interfaces on systems as part of security audits. Unexpected adapters may indicate unauthorized hardware or software installations.

  • Wake-on-LAN Configuration – Wake-on-LAN requires target system's MAC address. Getmac retrieves MAC addresses needed to create WoL magic packets for remote system power-on.

  • Network Monitoring Integration – Export MAC addresses with getmac /fo csv for import into network monitoring systems, IPAM (IP Address Management) tools, or CMDB (Configuration Management Database).

  • Troubleshooting Duplicate IPs – When duplicate IP address conflicts occur, getmac identifies MAC addresses of conflicting systems, helping locate physical machines on network.

Tips and Best Practices

Master these getmac techniques for effective network administration:

  • Use /v for Human-Readable Output – Verbose mode shows adapter names and connection names instead of just device paths. Much easier to identify "Intel Ethernet" than "\Device\Tcpip_{GUID}". Default getmac output is cryptic; always use /v for practical work.

  • Export to CSV for Inventory Managementgetmac /v /fo csv > inventory.csv creates spreadsheet-compatible output. Collect from multiple systems into single CSV file for central network adapter database. Import into Excel, Access, or network management tools.

  • Understand Virtual Adapter MAC Patterns – Virtual adapters (VirtualBox, VMware, Hyper-V, VPN) have recognizable MAC prefixes: VMware uses 00-05-69, 00-0C-29, 00-50-56; VirtualBox uses 08-00-27. Helps distinguish physical from virtual interfaces.

  • Combine with ipconfig for Complete Picture – Getmac shows MAC addresses; ipconfig shows IP addresses, DNS, gateways. Use together: getmac /v and ipconfig /all for comprehensive network configuration documentation.

  • Query Remote Systems with Care – Remote queries require admin rights on target and firewall exceptions. Test connectivity first: ping SERVER01. Verify remote management enabled on target. Omit /p parameter; enter password when prompted for security.

  • Filter Output for Specific Needs – Pipe to findstr for filtering: getmac /v | findstr "Ethernet" shows only Ethernet adapters. getmac /v | findstr /V "disconnected" excludes disconnected adapters. Reduces information overload.

  • Use Consistent Formatting – Choose one format (table, list, csv) and stick with it for consistency in documentation and scripts. Table for quick viewing, list for detailed review, CSV for data processing.

  • Document MAC Address Changes – Hardware replacement changes MAC addresses. Before replacing network adapters, document old MAC with getmac. After replacement, update DHCP reservations, MAC filters, and documentation with new MAC.

  • Recognize "Media Disconnected" State – Doesn't necessarily mean adapter is broken; could be cable unplugged, switch port disabled, or adapter disabled in Device Manager. Verify physical connectivity and adapter status.

  • Script for Multi-System Collection – Create batch scripts or PowerShell scripts that loop through computer lists running getmac on each. Automates inventory collection across entire network infrastructure.

  • Verify MAC Address Format Requirements – Some systems want MAC addresses with colons (00:1A:2B:3C:4D:5E), some with hyphens (00-1A-2B-3C-4D-5E), some without separators (001A2B3C4D5E). Getmac uses hyphens; convert format if needed for specific applications.

  • Check for Duplicate MACs – While rare, MAC conflicts can occur (cloned adapters, virtualization issues). Compare MAC addresses across network to identify duplicates causing connectivity problems.

Troubleshooting Common Issues

"RPC server is unavailable" Error on Remote Query

Problem: getmac /s COMPUTER returns "RPC server is unavailable" error.

Cause: Remote computer unreachable, firewall blocking RPC, Remote Procedure Call service not running on target, or network connectivity issue.

Solution:

  1. Verify remote computer is reachable: ping COMPUTER
  2. Ensure Remote Procedure Call service is running on target
  3. Check Windows Firewall allows "Remote Service Management" (RPC)
  4. Verify you have administrative privileges on remote system
  5. Try using IP address instead of hostname

Prevention: Configure firewall to allow remote management; ensure RPC service is running; maintain proper credentials for remote access.

Access Denied Error on Remote Computer

Problem: Remote query fails with "Access is denied" error.

Cause: Insufficient permissions on remote system; user account lacks administrative privileges.

Solution:

  1. Verify your account has administrator rights on remote computer
  2. Use /u and /p to provide administrative credentials: getmac /s COMPUTER /u DOMAIN\Admin /p (prompted for password)
  3. Check User Account Control (UAC) settings on remote system
  4. Verify user account is not disabled on remote system

Prevention: Use domain admin credentials for remote queries; ensure proper privilege delegation; document which accounts have remote management permissions.

No MAC Address Shown (Blank Output)

Problem: Getmac returns no MAC addresses or very limited information.

Cause: No network adapters present, all adapters disabled, driver issues, or network adapter hardware failure.

Solution:

  1. Verify network adapters exist in Device Manager
  2. Check if adapters are disabled; enable them
  3. Update or reinstall network adapter drivers
  4. Try ipconfig /all to see if it shows MAC addresses
  5. Check physical adapter is seated properly (for desktop PCs)

Prevention: Maintain current drivers; monitor adapter status; verify hardware is functioning.

"Media disconnected" for All Adapters

Problem: All adapters show "Media disconnected" status.

Cause: Network cables unplugged, Wi-Fi disabled, switch ports disabled, or adapters disabled in Device Manager.

Solution:

  1. Verify network cables are connected for Ethernet
  2. Check Wi-Fi is enabled (hardware switch, Windows settings)
  3. Verify adapters are enabled in Device Manager
  4. Test cable with known-good cable if Ethernet
  5. Check switch ports are active and properly configured

Prevention: Monitor adapter status regularly; use quality cables; document switch port configurations; check physical connections.

MAC Address Different from Ipconfig

Problem: Getmac and ipconfig /all show different MAC addresses for same adapter.

Cause: Usually same (should match); if different, may indicate reporting bug, virtual adapter behavior, or MAC spoofing/randomization.

Solution:

  1. Compare carefully—ensure looking at same adapter in both outputs
  2. Check if MAC address randomization is enabled (Windows 10/11 Wi-Fi privacy feature)
  3. Verify no MAC spoofing software is running
  4. If persistent discrepancy, investigate for malware or rootkit

Prevention: Disable MAC randomization if consistent MAC needed; avoid MAC spoofing unless explicitly required; use reputable software only.

Cannot Query Remote Computer by Name But IP Works

Problem: getmac /s SERVERNAME fails but getmac /s 192.168.1.100 works for same system.

Cause: DNS resolution failure, WINS failure, or NetBIOS name resolution issue.

Solution:

  1. Verify DNS is working: nslookup SERVERNAME
  2. Try fully qualified domain name: getmac /s SERVERNAME.domain.com
  3. Check hosts file doesn't have incorrect entry
  4. Flush DNS cache: ipconfig /flushdns
  5. Use IP address as workaround if name resolution can't be fixed immediately

Prevention: Maintain proper DNS configuration; ensure DNS records are current; test name resolution regularly.

Related Commands

ipconfig /all – Comprehensive Network Configuration

While getmac focuses on MAC addresses, ipconfig /all shows complete network configuration including MAC addresses ("Physical Address"), IP addresses, DNS servers, gateways, and DHCP information.

Example: getmac /v shows MAC and adapter name; ipconfig /all shows same MAC plus IP, subnet, gateway, DNS configuration.

arp -a – View ARP Cache (MAC to IP Mapping)

ARP (Address Resolution Protocol) cache shows MAC-to-IP mappings for devices on local network. Complements getmac by showing what other devices' MAC addresses are on network.

Example: getmac shows your MAC addresses; arp -a shows MAC addresses of other devices you've communicated with recently.

systeminfo – Complete System Information

Systeminfo displays comprehensive system information including network adapter details. More detailed than getmac but slower to execute.

Example: systeminfo shows network adapter models and configuration; getmac /v focuses specifically on MAC addresses with faster execution.

wmic nic – Query Network Adapters

WMIC (Windows Management Instrumentation Command-line) can query network adapter details including MAC addresses with flexible output formatting and filtering.

Example: wmic nic get MACAddress,Name,NetEnabled shows MAC addresses with adapter names and enabled status in customizable format.

PowerShell Get-NetAdapter – Modern Network Adapter Query

PowerShell's Get-NetAdapter cmdlet provides comprehensive network adapter information with object-based output, filtering, and integration with other PowerShell cmdlets.

Example: Get-NetAdapter | Select Name,MacAddress,Status shows adapter names, MAC addresses, and connection status in PowerShell format.

Device Manager (devmgmt.msc) – GUI Network Adapter Management

While getmac is command-line, Device Manager provides GUI for viewing and managing network adapters including MAC addresses in adapter properties.

Example: Device Manager → Network adapters → Properties → Advanced shows MAC address (called "Network Address") and adapter configuration.

Frequently Asked Questions

What does getmac command do?

Getmac displays Media Access Control (MAC) addresses for all network adapters on local or remote computers. It shows physical hardware addresses, adapter names (with /v), and connection status. Essential for MAC filtering, network inventory, and adapter identification.

How do I find my MAC address using getmac?

Open Command Prompt and type getmac /v. Output shows MAC addresses (Physical Address column) with corresponding adapter names. First entry typically Ethernet, second Wi-Fi if present. MAC address format is six pairs of hexadecimal digits (e.g., 00-1A-2B-3C-4D-5E).

What is the difference between getmac and ipconfig?

Getmac focuses specifically on MAC addresses with optional verbose adapter information. Ipconfig shows comprehensive network configuration including IP addresses, subnet masks, gateways, DNS servers, and also includes MAC addresses. Use getmac when you only need MAC addresses for cleaner output.

How do I get MAC address for remote computer?

Use getmac /s COMPUTERNAME /v where COMPUTERNAME is remote system name or IP. Requires administrative privileges on remote computer and firewall allowing remote management. Add /u DOMAIN\User and /p for alternative credentials if needed.

Why does getmac show "Media disconnected"?

"Media disconnected" means network adapter has no active connection—network cable unplugged for Ethernet, Wi-Fi disabled or not connected, or adapter disabled in Device Manager. Adapter exists and has MAC address but isn't currently connected to network.

Can I export getmac results to Excel?

Yes, use CSV format: getmac /v /fo csv > macaddresses.csv. This creates comma-separated values file that opens directly in Excel. /v includes adapter names and connection information. Collect from multiple systems by appending with >>.

How do I get only active network adapters with getmac?

Use: getmac /v | findstr /V "disconnected". This filters out adapters showing "Media disconnected" status, leaving only connected/active adapters. Alternatively use: getmac /v | findstr /V /I "media" for case-insensitive filtering.

What is verbose mode in getmac?

Verbose mode (/v switch) displays detailed information including connection name (e.g., "Ethernet", "Wi-Fi"), network adapter model name, physical address (MAC), and transport name. Much more readable than default output which shows only MAC and cryptic device paths.

Can getmac show MAC address for disabled adapters?

Yes, getmac shows MAC addresses for all adapters including disabled ones. Disabled adapters appear with "Media disconnected" status. MAC address exists regardless of enabled/disabled state since it's hardware identifier.

How do I use getmac in a script?

Use /fo csv for clean parsing and /nh to suppress headers: getmac /fo csv /nh. In batch scripts, use for /f to parse output: for /f "tokens=1,2 delims=," %%a in ('getmac /fo csv /nh') do echo %%a %%b. PowerShell can parse CSV output directly.

What MAC address prefixes indicate virtual adapters?

Common virtual adapter MAC prefixes: 00-05-69, 00-0C-29, 00-50-56 (VMware); 08-00-27 (VirtualBox); 00-15-5D (Hyper-V); 00-FF-XX (Microsoft's generic virtual). Physical adapters use manufacturer-assigned prefixes from IEEE OUI database.

Why do I get "RPC server is unavailable" error?

Error indicates cannot connect to remote computer's RPC service. Causes: remote computer unreachable (check with ping), Windows Firewall blocking remote management, RPC service not running on target, or insufficient permissions. Enable firewall exception for remote management.

Quick Reference Card

CommandPurposeUse When
getmacShow MAC addresses (basic)Quick MAC lookup
getmac /vShow MAC addresses with adapter detailsIdentify which adapter is which
getmac /v /fo csvExport to CSV formatCreate inventory spreadsheet
getmac /v /fo listDetailed list formatReview comprehensive details
getmac /nhSuppress column headersScript parsing, clean output
getmac /s COMPUTERQuery remote computerRemote inventory without physical access
getmac /s COMP /u USER /pRemote query with credentialsAccess with different permissions
getmac /v | findstr /V "disconnected"Show only active adaptersFilter out disconnected adapters
getmac /v > inventory.txtSave to fileDocumentation, comparison
getmac /fo csv > macs.csvExport for ExcelSpreadsheet analysis

Try Getmac Yourself

Ready to master network adapter management? Practice these commands in our interactive Windows Command Simulator where you can safely experiment with getmac and see realistic network adapter output.

Explore our complete Windows Commands reference for detailed syntax and options for getmac and 200+ other commands. For related network diagnostics topics, check out our guides on ipconfig, netstat, ping, and netsh.

Summary

The getmac command is a focused and efficient tool for retrieving MAC addresses from local and remote systems, essential for network administration, security configuration, and hardware inventory management. From basic MAC address display with getmac to comprehensive adapter information with getmac /v, remote system queries with getmac /s, and flexible output formatting with /fo, this utility provides everything needed for MAC address management.

Key concepts covered include understanding MAC address format and significance, identifying adapters by connection name and model, distinguishing connected from disconnected adapters, querying remote systems for centralized inventory, and exporting data in formats suitable for documentation and database integration. Mastery of these capabilities enables efficient network asset management and troubleshooting.

Remember that MAC addresses are hardware identifiers unique to each network interface—they don't change with IP address changes, driver updates, or operating system reinstalls (though they can be spoofed by software). This permanence makes them valuable for device tracking, access control, and inventory management across network infrastructure.

Common workflows use getmac for: configuring router MAC filtering (retrieve MACs, add to allow/block lists), creating network inventories (export CSV, import to database), troubleshooting network adapters (verify adapter detected and has valid MAC), and setting up DHCP reservations (collect MACs, configure static IP bindings). The focused nature of getmac makes these tasks faster than navigating through GUI interfaces.

Practice getmac regularly, especially the /v verbose mode which provides most useful information. Experiment with different output formats (/fo table, /fo list, /fo csv) to find what works best for your documentation and automation needs. Combined with ipconfig for IP configuration, netstat for connections, and netsh for network management, getmac completes your network administration command toolkit for comprehensive system management capabilities.