Wednesday, 7 February 2007

How to get the MAC Address of a remote machine

You can use the getmac command to get the MAC address (Hardware Address) of a remote computer.
You can type getmac /? to get the usage of the command.

GETMAC [/S system [/U username [/P [password]]]] [/FO format] [/NH] [/V]

Output of the getmac /? command:
Description:
This command line tool enables an administrator to display the MAC
address for one or more network adapters on a system.

Parameter List:
/S system Specifies the remote system to connect to.

/U [domain\]user Specifies the user context under
which the command should execute.

/P [password] Specifies the password for the given
user context. Prompts for input if omitted.

/FO format Specifies the format in which the output
is to be displayed.
Valid values: "TABLE", "LIST", "CSV".

/V Specifies that the detailed information
should be displayed in the output.

/NH Specifies that the "Column Header" should
not be displayed in the output.
Valid only for TABLE and CSV formats.

/? Displays this help/usage.

Examples:
GETMAC /FO csv
GETMAC /S system /NH /V
GETMAC /S system /U user
GETMAC /S system /U domain\user /P password /FO list /V
GETMAC /S system /U domain\user /P password /FO table /NH