Wednesday, December 3, 2014

3 ways to get remote computers MAC address on Windows Servers or Workstations

There are many ways to get remote computers MAC address on Windows. In this post, I'd like to show 3 ways to get MAC addresses. To get remote computers MAC address, you need to have administrative credential on remote computers and make sure firewalls of computers or network don't block the connection between both computers.

Getmac
Getmac is a built-in command started from Windows XP to get mac addresses from a local computer or remote computer.

On "Command Prompt", perform "getmac /v /s <Remote Computer Name> /U <Remote or Domain User Account with administrative privilege> /FO <List, Table or CSV>" to get MAC addresses from a remote computer.


Enter the password of the account to get the result.

Remark: Both computers communicate with TCP port 135.

Windows Management Instrumentation Command-line (WMIC)
Windows Management Instrumentation Command-line (WMIC) is a command to work with WMI to get or modify the settings of a computer. In this case, I'm going to use wmic to get a remote computer MAC address.

On "Command Prompt", perform "wmic /user:<Remote or Domain User Account with administrative privilege> /node:<Remote computer name> nic list brief".


Enter the password of the account to get the result.

PowerShell
PowerShell is a good way to get information from computers. It's easy for administrators to learn and use. By the way, we can perform the following cmdlet to get MAC address from remote computers.

On "PowerShell" console, perform "Invoke-Command -ComputerName <Remote Computer Names> -Credential (Get-Credential) -ScriptBlock {Get-CimInstance -ClassName Win32_NetworkAdapter | FT Name,MacAddress -AutoSize}" on Windows 8, Windows 8.1, Windows Server 2012 or Windows Server 2012 R2.


Enter the user name and password with administrative privilege of the remote computer.


Remark: Get-CimInstance is a built-in cmdlet on PowerShell 3.0 or later. For Windows 7 or Windows Server 2008 R2, we can perform "Get-WmiObject -Class Win32_NetworkAdapter -ComputerName <Remote Computer Name> -Credential (Get-Credential)".


Enter the user name and password with administrative privilege of the remote computer.


Eventually, we got MAC addresses from above methods.

More information:




This posting is provided “AS IS” with no warranties, and confers no rights!

No comments:

Post a Comment