Category filter

Script to get MAC address of Windows devices

Knowing your device’s MAC address is very important as it helps in identifying a specific device from a fleet of devices. It can be used to filter out certain devices from connecting to a specific network or be used to monitor network traffic on a specific device. Since every device has a unique MAC address, it is the best parameter to identify a device and perform actions on it. Hexnode offers a feature where you can fetch the MAC address of a Windows device remotely by executing custom scripts.

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Batch Script

Using the ‘ipconfig’ command

This script displays different parameters of your Windows device’s IP configuration. The Physical Address listed here is the MAC address of your Windows device.

Using the ‘getmac’ command

This script displays the MAC addresses associated with all the active network adapters on your Windows device.

PowerShell Script

The following PowerShell script displays the network MAC address of a Windows device.

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository