Using worklet to deploy files

I am wondering if anyone has tried using Automox to deploy files to users. We have many remote users and every once in a while we need to deploy a batch file or RDP to their desktop.

In the past it was reliant on them connecting with VPN to our site and downloading the appropriate file. I would like to remove the shared folder dependency and upload the file to Automox and deploy directly from there.

What i was looking to do was something like

Copy-Item -Path ".\file.rdp" -Destination "C:\Users\Public\Desktop"

which does work when run in PowerShell from the folder containing the file.

It doesn’t need a remediation script just the ability to execute and deploy/overwrite any existing files. Thanks in advance!

1 Like

You could modify this worklet to do what you’re needing:


Just change the file name and location in the remediation code and get rid of the shortcut generation code.

It takes a file that you put in the Installation File slot and copies it to another location. Then for the evaluation you can just put Exit 1 so that the policy will run on the schedule that you set it to (daily, weekly, monthly, etc.)

Note that the Installation File will be in the same directory that the code runs, so you don’t need to put in a path for the source location. Whenever you have a new version of the file you can just replace the existing one in the worklet.

1 Like

Hi Nic, apologies for hijacking someone else’s thread, but I’m trying to deploy the Splashtop SOS application to a Windows device using this worklet but it’s not working for me. I should say that this is my first attempt at a worklet and at software deployment using Automox.

I’ve created the worklet, uploaded the exe file and used the Powershell scripts below. I then applied that policy to a test group containing a single device.

Evaluation code:
if (Test-Path -Path “C:\Users\Public\Public Desktop\SplashtopSOS.exe”) {
exit 0
} else { Exit 1 }

Remediation code:
Copy-Item SplashtopSOS.exe -Destination “c:\Users\Public\Public Desktop\SplashtopSOS.exe”

In the log I see that the policy has been run, but the file has not been copied onto the machine.

How can I diagnose what is wrong?

Thanks

Try putting the .\ in front of the SplashtopSOS.exe in the remediation:

Copy-Item .\SplashtopSOS.exe -Destination “c:\Users\Public\Public Desktop\SplashtopSOS.exe”

I’ve had that trip me up before and cause files not to be copied that I’ve uploaded to a worklet.

1 Like

Thanks Nic. Good suggestion, but unfortunately it didn’t work. Is there any more detailed log I can look at, maybe on the endpoint?

You can look in the Activity Log report to see the execution status of the remediation code. You can also use stderr to pipe info to the Activity Log to get more detail on what’s going wrong. I’m assuming you’ve run the remediation code directly on the device just to make sure it runs ok?

No, I didn’t know I could do that. I assumed the file is located on your servers, so how would the command know where it was? As I mentioned, I’m new to worklets :grin:

I meant just run the command in powershell locally on the machine to make sure it works outside of the Automox worklet environment. That helps us narrow down if it’s a problem with the code, or something on our end.