‎02-28-2023 09:31 AM - last edited on ‎06-27-2023 01:43 PM by ErikT
This is a command I use to deploy LsAgent from internet setup link rather from a package share:
curl -o LsAgent-windows.exe "https://cdn.lansweeper.com/download/10.0.1/1/LsAgent-windows.exe"&&LsAgent-windows.exe --mode unattended --server "YOUR_LANSWEEPER_FQDN" --agentkey "YOUR_LANSWEEPER_AGENT_CLOUDRELAY_KEY"
I will try to find a powershell command for the same.
‎03-02-2023 06:52 AM
Dear CyberShot, thank you for your input, please note that you need to mention full path in the Start-Process command, otherwise you will get the below message:
Here is a few changes in your command for better result, also I replaced the direct static link with the dynamic link for LsAgent which works fine under PowerShell:
Invoke-WebRequest -Uri "https://content.lansweeper.com/lsagent-windows/" -OutFile "C:\Windows\TEMP\LsAgent-windows.exe"; Start-Process -FilePath "C:\Windows\TEMP\LsAgent-windows.exe" -ArgumentList "--mode unattended --server YOUR_LANSWEEPER_FQDN --agentkey YOUR_LANSWEEPER_AGENT_CLOUDRELAY_KEY" -Wait
Although the downloaded file is working correctly.
‎03-02-2023 06:55 AM
Thanks Dude, I asked ChatGPT to write the script, I tested that it was downloading etc, but not that it ran as we deploy via a Lansweeper report and our MDT Build process.
‎03-01-2023 01:18 AM - edited ‎03-01-2023 01:19 AM
Not heavily tested as we don't use it this way, but this should work as a powershell script.
Invoke-WebRequest -Uri "https://cdn.lansweeper.com/download/10.0.1/1/LsAgent-windows.exe" -OutFile LsAgent-windows.exe; Start-Process -FilePath "LsAgent-windows.exe" -ArgumentList "--mode unattended --server YOUR_LANSWEEPER_FQDN --agentkey YOUR_LANSWEEPER_AGENT_CLOUDRELAY_KEY" -Wait
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now