Download a file using WebUI

Anyone ever tried to download (which really means you will be uploading it to the root server sha1 area) a file from either Windows or Linux?

Trying to download/upload a file from a linux machine using:

if {exists file “rpms.xml” of folder “/var/opt/BESClient/LMT/CIT/RPM”}
action uses wow64 redirection false
upload now “/var/opt/BESClient/LMT/CIT/RPM/rpms.xml” as “rpms.xml”
endif

But WebUI keeps barking at me for this “Error: This expression contained a character which is not allowed.”

It looks like you’re trying to use the Archive Now function, but I’ve never heard of upload now—that command doesn’t exist in BigFix Action Script.

Also, when writing an action script for Linux/Unix devices, the line action uses wow64 redirection false is not applicable, as WOW64 redirection is only relevant for Windows systems.

Your corrected action script should look like this:

if {exists folder “/var/opt/BESClient/LMT/CIT/RPM” whose (exists file “rpms.xml” of it)}
setting "_BESClient_ArchiveManager_FileSet-{computer name}"="/var/opt/BESClient/LMT/CIT/RPM/rpms.xml" on "{parameter "action issue date" of action}" for client
setting "_BESClient_ArchiveManager_SendAll"="0" on "{now}" for client
setting "_BESClient_ArchiveManager_MaxArchiveSize"="200000000" on "{parameter "action issue date" of action}" for client
setting "_BESClient_ArchiveManager_OperatingMode"="2" on "{now}" for client
archive now
endif

For more details on configuring Archive Manager, refer to:
Upload and Archive Manager

Archive Manager Settings

2 Likes

Wow, all of that just to download a file from an endpoint?

I’m not sure what you used but Microsoft Copilot has surprisingly been much better at relevance and actionscript during my testing in the last 6 months than Gemini or ChatGPT.

I’ve seen some pretty solid logic and syntax from Copilot where most of what comes from Gemini seems to be some piecemealed SQL type statement.

I had used Grok from X.com, which is usually spot on. Apparently HCL needs to create an AI engine just for Bigfix.

If I’m understanding it correctly, the ask is to upload a file from an endpoint to the root server

It’s rare, I think to upload from just one client. Usually we would upload from all the clients - retrieving things like Inventory scan results or log files or such.
And to repeat the uploads daily. That’s the case the Archive Manager is truly tuned to handle.

For ad-hoc uploads there are nasty questions like ‘which clients do I trust’ and ‘which files on the server should a client be allowed to overwrite’. That’s why no client is allowed to decide where the upload ends up - it only goes into the ArchiveManager directory, into a subdirectory based on Client ID.

Here is the reason.

It’s for a case I have open for BFI and they wanted a file/folder off of some endpoints.

I also do NOT have access to the server but I am a MO with Bigfix.

While the archive now should work fine for copying a file through the relay up to the root server, you would still need permissions on the root server to get to the archive directories for your clients to pull the files off. Depending on your relay structure this isn’t always a quick thing.

In the past, I’ve needed to get logs off of a handful of clients and setup a temporary share on a file server that had authenticated users with write permissions on it and a powershell script that copied the files I needed to that share and named the file so that you could identify it by computer name. But I also realize that some companies might restrict powershell or other things from running that might not be appropriate in your org.

I am a full admin on the Windows Root box.

Then I believe the post above from vk.khurava should do what you are looking for.