|
EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
|
Access the official MeshCmd user guide in your preferred format

This user guide contains all essential information for the user to make full use of MeshCmd, a command line tool used to perform tasks on MeshCentral and for IntelĀ® AMT. This tool run on Windows and Linux and perform a wide array of different tasks. From routing traffic over the Internet to activating Intel AMT, MeshCmd is a great do it all tool for computer management.
MeshCmd, called āMesh Commandā, is a command line tool that runs on both Windows and Linux and used to perform many tasks related to computer management. As the tool continues to evolve, it will continue to be improved and acquire more features.
Broadly, the tool is intended to perform three sets of tasks :
There are command line operations that relate to interacting with the MeshCentral2 server. A good example of this is to route traffic from your computer to a remote computer on the internet thru a MeshCentral2 server.
If you happen to have Intel AMT on your computer, MeshCmd can take a look at the version and activation status, activate and de-activate Intel AMT and help with getting access to Intel AMT and more.
Whether you have Intel AMT on your local computer or a remote computer on your network, MeshCmd can help unlock the features Intel AMT provides. From getting the state of Intel AMT remotely to running configuration scripts and loading MeshCommander into Intel AMT web storage.
To get started, you need to download MeshCmd for your computer. MeshCmd is a single file executable that you can get on MeshCommander.com at: http://www.meshcommander.com/meshcommander/meshcmd
If you have access to a MeshCentral2 server, the download link to MeshCmd is at the bottom left of the main device page.

Once you click on the MeshCmd link, a dialog box will allow you to select the operating system you want to get a link to MeshCmd. MeshCentral will also provide an action file called meshaction.txt that contains information on how MeshCmd can connect back to that MeshCentral server. This is optional, and only used for some operations.
Once downloaded, just run it from the command prompt or terminal window.
By default you will get the help screen with all of the different actions you can take with the tool. You can also get help by typing help followed by the action name. In this document we will cover the main actions that MeshCmd can perform. If you donāt use Intel AMT at all, then only the MeshCentral actions are interesting for you. If you use Intel AMT, the rest of the actions will be of interest to you.
MeshCmd can map a TCP port from your local computer to any remote port on any computer with one of your MeshAgents installed. This port mapping will work over a local network or the Internet and should work even thru proxies and firewalls.
In order to start using MeshCmd in this way, you first need to have access to a MeshCentral server and at least one computer you already manage. TCP port mapping works by selecting a port on your local computer that will be routed to a remote device and port. Here, local port 123 is routed thru the server to port 123 on a remote device.

Of course, this picture is a bit simplify. Firewalls, NAT routers and HTTP proxies may be in the way and the MeshAgent on the remote computer will act at the TCP traffic relay in most cases.
One typical use of this is to route local port 1234 to port Microsoft RDP port 3389 on a remote device. Once routed, you can start a RDP session on localhost:1234 and get a RDP session to the remote device. The RDP protocol is feature rich and efficient, so you get a great user experience regardless of where in the world the remote computer is at.
To get started, click on a device in MeshCentral and click on the Router link on the bottom left of the device page.

You can download MeshCmd is you have not done so already, but more importantly, download the action.txt file. The file is in text format and contain something like this :
The action file contains almost all the parameters needed to perform the route. It indicates the local and remote ports, the remote computer unique identifier, server location and authentication information and more. You can just put the action file in the same folder as MeshCmd and run MeshCmd, it will automatically pick up the arguments from the meshaction.txt file.
You may want to change the local and remote port in the action file to suite your needs. By default, the Microsoft RDP port is the target. If the password is not specified in the meshaction.txt file, you can also specify it as a meshcmd argument.
MeshCommander is a web based Intel AMT management console. MeshCmd has no less then three different versions of MeshCommander built-in, so if you are using Intel AMT, itās worth a moment to get some knowledge about MeshCommander which is available as a standalone tool along with a full userās guide at:http://www.meshcommander.com/and also included as part of MeshCentral.
The three versions included in MeshCmd are :
In this section, we review the three versions, how they are used and what can be done with them.
You can start MeshCommander on a local web server by typing meshcmd meshcommander. By default, local port 3000 is used, but you can optionally specify the port using --localport [port]. Running it with look like this:
Once running, use a web browser and go to http://localhost:3000 to see the MeshCommander web page. The page will start out without any computers in it and you will have to add some.

In this mode, the local computers that are added will be stored in the browserās storage cache. So, clearing the browserās cache will also clear the list of computers. You can however load and save the list of computers using the Open⦠and Save⦠buttons. This version of MeshCommander will have some limitations when compared to the full version installed using the Windows .MSI installer. Notably :
This said, features like KVM, Terminal and most Intel AMT configuration options are available which makes this a fairly powerful Intel AMT management console.
You can run MeshCommander as a background server on both Windows and Linux. To do this, use the install, uninstall, start and stop commands like this:
On Linux computers, both systemd and initd are supported. When installing, the MeshCmd executable will be copied to a different installation folder.
The Layered Management Service (LMS) is a background process that runs in the operating system and provides local OS access to Intel AMT. More specifically, it redirects local TCP ports 16992 and 16993 to Intel AMT thru the MEI driver. One way to check if the LMS service is installed on your computer is to try http://localhost:16992 or https://localhost:16993 in a browser. A page should generally show up.
š Note :
On Windows, LMS is a Windows service that must be downloaded and installed as part of the OEM drivers for a computer.
On Linux, itās generally never installed and users normally have to download the source code and compile it themselves.
MeshCmd has its own LMS implementation, so is LMS is not installed it will automatically use its own internal one. In addition, you can run MicroLMS alone by typing the following list while running as root or local administrator:
This will start MicroLMS and as indicated, start MeshCommander on local port 16994 at the same time.
In total, traffic redirection looks like this :

In addition to providing normal services, MicroLMS that is part of MeshCmd will also start a web server on port 16994 and allow a browser to access LMS MeshCommander, a special version of MeshCommander specially made to run in this situation.
MeshCommander for LMS will show up even if the computer has Intel AMT un-configured and offer the user the choice to activate Intel AMT and perform configuration actions. In the following screen, we see a computer activated in Client Control Mode.
Because itās in this mode, you can use the web interface to de-activate Intel AMT or login to perform additional configuration.

MicroLMS along with MeshCommander for LMS is very useful, especially on Linux as it offers a single tool to setup and configuration Intel AMT. If you wish you run MicroLMS without MeshCommander being available on port 16994, run MeshCmd with --noconsole:
You can run MicroLMS as a background server on both Windows and Linux. To do this, use the MicroLMS install, uninstall, start and stop commands like this :
On Linux computers, both systemd and initd are supported. When installing, the MeshCmd executable will be copied to a different installation folder.
MeshCmd also includes a surprising version of MeshCommander, the one you can load into the firmware of Intel AMT. Starting with Intel AMT 11.6, you can push into the small ~190k storage space of Intel AMT a replacement to the index.htm page served by the firmware on port 16992 & 16993. In the following picture, the left side is the original Intel AMT web page, the right is the replaced MeshCommander built to go in firmware.

The firmware version of MeshCommander has support for remote desktop, terminal and all sorts of Intel AMT usages and configuration. Probably the most surprising is that this entire page is between 40k and 100k depending on the version you select. Itās notable that with MeshCommander loaded into Intel AMT firmware, one does not need any other tool except for a browser to perform most Intel AMT maintenance operations.
To get the current state of Intel AMT web storage, type this :
Here, a 57k index.htm replacement is present in the Intel AMT flash. You can clear the web storage, revering the web page back to the original like this:
When MeshCommander is loaded into Intel AMT, you can access it from a different computer using http://computername:16992 or https://computername:16993 You will need to authenticate first before getting access to the web page.
MeshCmd can easily be used to read the local state of the computer and Intel AMT. There are many commands available to do this. The SMBios action works on most computers and is used to get basic information about your current system. The output is JSON format.
If you have Intel AMT on your system, you can use the amtinfo, amtversions and amthashes to get lots of information about Intel AMT current state. These commands use the Intel AMT MEI driver to get this information and require MeshCmd be run as root or administrator :
meshcmd amtinfo
C:\MeshCmd>meshcmd amtinfoIntel AMT v8.1.71, activated in client control mode.Wired Enabled, DHCP, 00:1E:8C:F5:4F:ED, 192.168.2.10.
meshcmd amtversions
C:\MeshCmd>meshcmd amtversionsMEI Version = MKQ7710H.86A.0072.2017.0519.1347Flash = 8.1.71Netstack = 8.1.71AMTApps = 8.1.71AMT = 8.1.71Sku = 24584VendorID = 8086Build Number = 3608Recovery Version = 8.1.71Recovery Build Num = 3608Legacy Mode = False
meshcmd amthashes
C:\MeshCmd>meshcmd amthashesVeriSign Class 3 Primary CA-G1, (Default, Active)SHA256: E7685634EFACF69ACE939A6B255B7B4FABEF42935B50A265ACB5CB6027E44E70VeriSign Class 3 Primary CA-G3, (Default, Active)SHA256: EB04CF5EB1F39AFA762F2BB120F296CBA520C1B97DB1589565B81CB9A17B7244ā¦
In addition to getting Intel AMT state, MeshCmd can activate Intel AMT in client control mode (CCM) and de-activate Intel AMT if itās in this mode. Doing this is very simple, starting with Intel AMT not being activated, you use the amtccm and amtdeactivate actions.
meshcmd amtinfo
C:\MeshCmd>meshcmd amtinfoIntel AMT v8.1.71, pre-provisioning state.meshcmd amtccm --pass xxxxxxxx
C:\MeshCmd>meshcmd amtccm --pass xxxxxxxxSuccessmeshcmd amtinfo
C:\MeshCmd>meshcmd amtinfoIntel AMT v8.1.71, activated in client control mode.meshcmd amtdeactivate
C:\MeshCmd>meshcmd amtdeactivateSuccess
š Note :
Note that when using the amtccm action, you need to provide a password that will be used for authentication into Intel AMT. This password must be strong with at least 8 characters including a lower case, an uppercase, a numeric value and a non-alpha-numeric value.
One very useful feature of MeshCmd is its ability to fetch the Intel AMT audit log. This can be valuable when doing forensics on a computer or just trying figure out what is being done thru Intel AMT. MeshCmd can pull the audit log on a local computer without any credentials, as long as itās running as root or administrator, or pull the audit log remotely if usual credentials are provided.

The Intel AMT audit log will show when a computerās Intel AMT was activated, when remote desktop sessions where initiated and more. To get the local audit log, just use the āAmtAuditLogā action.
To get a remote audit log :
You can also save the audit log to file using the --output option.
MeshCmd has a full WSMAN stack built-in and can be used to run .mescript file on a target Intel AMT computer. Script file are useful when you want to run a set of actions on one or more Intel AMT computers at once. You can build a .mescript file using the script editor within MeshCommander.
This script editor allows the user to drag & drop script blocks, set parameters on each block and test the script against a connected Intel AMT computer.

In addition to building your own scripts, you can download a CIRA setup script from a MeshCentral server. When running this script, Intel AMT will be setup to call back to the server using an encrypted connection. This enables remote management of Intel AMT over the Internet. The CIRA setup script is available in the Add CIRA link for meshes that are Intel AMT only (no agent).

Once you got the script, run it with MeshCmd like this. You specify the host if itās not localhost, the password and the script file.
In this example, the CIRA setup script was run on a remote computer. After the script is run, the computer got configured and connected back to the server. MeshCentral show the new connection state for this computer.

MeshCmd has all the code needed to perform Intel AMT IDE Redirection from the command line. This allows disk images on the administratorās computer to be remotely mounted to an Intel AMT computer. You need to start with a floppy disk .img file and/or an .iso CDROM file.

Then use the AmtIDER command of MeshCMD to start an IDER session. The help command for AmtIDER looks like this:
The command is fairly simple. It takes as input a remote host, username/password for Intel AMT login, the disk images and TLS option. One can also specify the timeout option so that MeshCMD will automatically disconnect when no disk read operations are performed for a set number of seconds.
MeshCmd is a cross-platform command line tools that perform an ever-growing list of actions that are important for remote computer management. MeshCmd works alone or with MeshCentral and MeshCommander to offer a suite of free, opens source and powerful tools that work well together.
MeshCmd and this document are both opens source and licensed using Apache 2.0, the full license can be found at https://www.apache.org/licenses/LICENSE-2.0