Home ยป PowerShell ยป How to Get the MAC Address of a Remote Computer in PowerShell

How to Get the MAC Address of a Remote Computer in PowerShell

The PowerShell command to get the MAC address of a remote computer is Get-WmiObject. This command uses the Win32_NetworkAdapterConfiguration class and ComputerName parameter to specify the remote computer name.

Here is the PowerShell command to get the MAC address of a remote computer.

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName <RemoteComputerName> | Select-Object -Property MACAddress

In this article, we will discuss how to get the MAC address of a remote computer using PowerShell.

Get the MAC Address of a Remote Computer using PowerShell

To get the MAC address of the remote computer incorp-eu-01, use the following command.

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName incorp-eu-01 | Select-Object -Property MACAddress

In the above PowerShell script, the Get-WmiObject command returns the MAC address of the first network adapter that is configured on the remote computer.

The Get-WmiObject command uses the -ComputerName parameter to specify the remote computer name.

The -Class parameter specifies the class of the Wmi object to get. In this case, the class of the object is Win32_NetworkAdapterConfiguration.

The Select-Object command selects the specified properties from the object. In this case, the property that is selected is MACAddress.

The output of the above PowerShell script to get the MACAddress of the remote computer is given below.

Get the MACAddress of Remote Computer
Get the MACAddress of the Remote Computer

Conclusion

I hope the above article on how to get the MACAddress of the remote computer using the PowerShell command Get-WmiObject is helpful to you.

When using the command to get the MACAddress of the remote computer, keep these additional things in mind.

  1. The remote computer must be running Windows OS
  2. The user who runs the PowerShell command must have permission to access the remote computer.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.