Script to Install KACE
I mean... if it's not installed, then you cannot use the KACE SMA to install the agent.
Do you want to Install the agent for the first time? You could try provisioning from the KACE SMA OR use a GPO Policy.
Or upgrade existing agents?
There's quite a few different ways to do this. One example below.
First you'd want to check if the KACE agent is already installed.
wmic product get description | findstr /C:"KACE"
This should return "KACE Agent".
You'll want to capture that desired output, and continue execution if it's not present.
If it's not present, you'll want to download the MSI from a repository or file share, depending on your environment. If it's a new system image, consider having the MSI on the image and installing during the deployment process. Perhaps you could build it into an image from the KACE SDA if that's an option.
If you're looking for a command you can run that will install your KACE agent msi on a new system.
msiexec /i "C:\PATH\TO\FILE\ampagent-10.0.0-x86_k1000.yourdomain.com.msi" /qn /norestart
You would need the MSI on the target destination, and the PATH/TO/FILE/ would need to match the location of the MSI.
Like I said, there are many ways to accomplish this including a group policy, though in more distributed environments, accessing a DC to apply the policy remotely might not be an option.
Group Policy or through imaging is probably the easiest method, particularly if you're working from a single location.
I hope this helps.