Installing Windows 10 Agent Silent and Unattended Via Command Prompt?

Hi,

I want to know how if its possible to install the MeshCentral agent unattended on Windows 10 via command prompt running in Administration, that I can download the agent.exe with wget style to pull the installer in to windows and install it on the background unattended?

We have 100s of NUCs running off site and we have shell access of Command prompt if i could install the agent via this method it would be very good.

Thanks All Gokhan

Posted Mar 21, 2021, 8:13 PM UTC

116
nroach44•

Just set this up on a share that the computer user account can read (authenticated users or domain computers == read and execute) and set it up in a scheduled task or startup script in your GPO:

@echo off

SET CHECKFILE="C:\Program Files\Mesh Agent\MeshAgent.exe"

SET INSTALLERPATH=%SMBSHARE%
SET INSTALLER32=meshagent32-z_NewAgents.exe
SET INSTALLER64=meshagent64-z_NewAgents.exe
SET INSTALLERARGS="-fullinstall"

reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT

IF EXIST %CHECKFILE% (
  echo Already installed. Quitting.
) ELSE (  
  echo Installing...
  if %OS%==32BIT %INSTALLERPATH%\%INSTALLER32% %INSTALLERARGS%
  if %OS%==64BIT %INSTALLERPATH%\%INSTALLER64% %INSTALLERARGS%
)
5

Yes, I’m doing this with GPO in our org. Take a look at this thread : https://www.reddit.com/r/MeshCentral/comments/g5fa6m/how_to_automate_installation_of_meshagents_with/?utm_source=share&utm_medium=ios_app&utm_name=iossmf

But in theory it’s scriptable with or without gpo, if you have another tool on the PCs that can run powershell then it’s easily changeable to support that.

I am using BITS to download the file instead of wget since BITS is part of the windows OS.

3
ryanblenis•

If you have other means of running the command (remote PS, other RMM, GPO, etc.), absolutely.

Just run
C:\path\to\meshagent.exe -fullinstall

3
Live_DistributionOP•

Hi All,

Thanks for your replies.

I just figured it out by running the meshagent exe in command prompt and running a random switch which gave me the info to the correct path :)

I just tested it and its all working good.

On Win10 I do the following CMD:

mkdir c:\meshagent

cd c:\meshagent

curl.exe "url of meshagent from meshcentral" --output meshagent.exe

meshagent.exe -install

​

Thanks all again

3
Live_DistributionOP•

I guess with regards of AMT ACM mode I can only do this via the USB method and no way of installing the certificate remotely ?

1
Extcee•

My un-elegant way via admin command line:

powershell -command "& { (New-Object Net.WebClient).DownloadFile('http://xxx.yyy.com/meshagent64-AgentDevices.exe', 'C:\meshagent64-GroupName.exe') }" && C:\meshagent64-GroupName.exe -fullinstall

I have targeted groups on the app I push so I have commands for x64 and x86

1