Kaseya Community

How to install Kaseya Agent via batch file?

This question is not answered

I am transferring a bunch of endpoints that are managed by a competitor RMM, so I have privileged console access to the target machines. I am trying to run the following batch file, but it seems to get hung up on downloading the kcssetup.exe file. I've had it work here and there, but there doesn't seem to be any consistency. Does anyone have a better way to install Kaseya via batch file? The machines I need to migrate are not domain controlled, so deployment via logon script or policy is not an option, nor do I have unified credentials so install via lan watch won't work either. Here is my script (certain elements obscured)

powershell -Command "(New-Object Net.WebClient).DownloadFile('https://xxxxx.kaseya.net/deploy/#/xxxxxxx/xxxxgroup.root', 'c:\Windows\temp\KcsSetup.exe')"
c:\Windows\temp\KcsSetup.exe /s

All Replies
  • A couple of thoughts:

    Is the competitor also using Kaseya? The installer may be bailing because it sees an agent already in place, which means you'll need the /r command switch as well.

    Hanging up on downloading, though, suggests that the URL to the auto-generated installer doesn't play well with whatever CURL-like call Powershell is making. You might need to stage the file on a webserver and download from that instead.

  • The other RMM is Atera. The download was definitely failing because Powershell lacks a compatible SSL method, but when I staged the file to cloud storage, I was sometimes able to get it to work, and sometimes not. I'm not sure why. I suspect my biggest hang-up right now is being able to pull the installer to the target machine when I am limited to using the command line via remote, privileged console session.

  • , you are using a URL from the System tab, that URL brings up an HTML page that the user can click on.     Try creating a package from the Agent Tab, Packages, Manage Packages, and use that URL.  That will download directly.

    The URL should look something like this:


  • Yup, I figured that much. The problem is still finding a way to download the file from a remote location via console. I can't find a reliable command that works in a batch file, and I don't know that I can rely on anything other than what's available in plain vanilla windows.

  • We have a procedure + EXE that is part of our suite that handles this for agent removal and remove/re-deploy, such as when moving from SaaS to On-Prem or one VSA to another. The key is using the URL that Chris mentioned and downloading directly from the target VSA - the other URLs invoke scripts that require human interaction.

    One of the challenges we're seeing recently is that our Go Daddy SSL cert isn't being recognized by some systems because the local root cert has expired and the system hasn't been updated in a while. We had to allow fallback to non-SSL for the download to succeed - our logic accounts for this fallback. Once we take control and update the system, it isn't an issue. Just something to be aware of that makes this kind of automation a bit more challenging.