Stagger scheduled script runs or recognize that "required files" already exist

We have a couple scripts that have “required files” which Syncro downloads to the machines. While making a transition from one AV solution to another, we were running a script with an uninstaller every hour because there are a lot of machines that are only on for a short period of time. Syncro apparently just re-downloads the required file each time. This has been causing some issues for a couple customers who don’t have the best internet.

Would it be possible to either be able to tell a script to stagger scheduled runs over a period of something like 15 minutes, or have the agent check to see if the required file already exists before re-downloading it?

Rather than using synco file storage to push the file down do something like this. WE use a method like this when the file we want downloaded is to big for syncro. You could easily put if statement around this so it only downloads if it doesn’t already exist.

$dir = “c:\temp”

$url = https://go.microsoft.com/fwlink/?LinkId=212732

$file = “$($dir)\MSERT.exe”

Invoke-WebRequest -Uri $url -OutFile $file

Start-Process -FilePath $file -ArgumentList “/F:Y /Quiet”

image001.png

For most things we do that, but not every file has a static address it can be downloaded from.

Ya, I put it on onedrive/sharepoint and make a public share for that then. Seems to work well. You just have to put &download=1 at the end of the URL I think….

image001.png