How to distribute a folder and its contents using BigFix

How to distribute a folder and its contents using BigFix

07/31/2024

?

Very recently I had a customer that was facing a challenge of getting a piece of software without an installer distributed out to the systems requiring it with using BigFix. This was a little unique of a challenge but one that I felt we could accomplish. The challenges faced in this process were that of distribution of a large folder and all of its contents and also, making sure we had the permissions necessary to place the software.

?

This is the fix I came up with that seems to do the trick with a minimal amount of time effort. There are other ways of course leveraging other capabilities but I found this one to be a “quick fix”. I do lean on BigFix software distribution here quite a bit so that’ll be a requirement here to do this. Here are the steps:

?

?

  • That file when you download it downloads as a zip, extract it so we can use that software

  • Should be left with this folder and its contents:

  • Take the folder you’re trying to deploy and put it inside of another folder. The reason we’re doing this is that when the file is extracted, just the contents will remain
  • Folder to hold what I actually want to send:

  • VS the folder I want to send:

  • Next, once we have that folder nested the way it needs to be, we’re going to go ahead and “create” a BigFix Archive file out of it so that we can send it easy.
  • To create the file use an elevated command prompt, call up the bfarchive.exe file that you downloaded and extracted and give it the source file and the name you want the archive to be after it has “archived” it.
  • Bfarchive.exe -a “SourceFilePath” “Name you want the archive to be called”

C:\Users\bigfixsvc\Downloads\bfarchive-win-x64>BFArchive.exe -a C:\Users\bigfixsvc\Downloads\FolderToHoldWhatIWantToSend C:\Users\bigfixsvc\Downloads\FolderIwantToSendArchive        

  • The above needs to be all in one line (wraps it because of how long it is)
  • Output should look like this:

  • Once that steps finish this next step I use just a quick bat file to execute. There again are other ways to do this but this seemed too easy to not just run this direction.
  • Open notepad and do a simple “move” command for command prompt.
  • Move “Path of folder” “new location for folder”

  • Code Version:

move "C:\Program Files (x86)\BigFix Enterprise\BES Client\__BESData\actionsite\__Download\FolderIActuallyWantToSend" "C:\Windows\Temp\FolderSendBES"        

  • Don't forget once you've created the file make sure to change the file extension to a .bat.
  • Once those two files are created we’ll plug that into a software distribution job. To do this, launch your BigFix console and use the navigation tree on the left side to go to Dashboards > All Dashboards > “Manage Software Distribution” Dashboard.

  • Right side of the screen where the dashboard is displayed should look like this:

  • Once here, click “New Package” at the top left corner of the dashboard, provide all the information you’d like here and the sharing rights and then click “confirm”.

  • What you'll need to fill out:

  • Next, you’ll add the files to the job. While selecting the new package you just created under the package library (highlight the row vs the checkbox), you’ll an option a little lower in that same screen to “Add Files…”. Click that and instruct the console to import in those two files you created (archive file and the .bat files).

  • You'll have to do this step twice to get both the files into the job!

  • First File:

  • First File Add to Package:

  • Second File Add to Package:

  • What it should look like once you're done:

  • Once those upload, you’ll see a “Manage Task” button just to the right of the “Manage Files” area you were just in uploading those files. Click that and click “New Task…”.

  • The first box that’ll pop up called the “Create Distribution Task” and that is where we’ll associate those files. Put a checkbox next to both the archive file that you created and the .bat file. When you associate the bat file to the job it’ll automatically associate a generalized call for the execution of the bat file on the next screen; the default call is appropriate here. Leave everything default and click next.

  • Progress through the creation of distribution task:

  • This next screen is where you can apply any applicability conditions you’d like. For the purposes of this process, I won’t be setting any but you can if you’d like easily there or from editing the task itself later.

  • After you click “Create Task” you’ll be given a security warning asking if you want to continue creating the content, click continue here.

  • Then you’ll be in the final “create task” area to finish customizing this job.

  • Go to the actions tab on the task and we’ll make some quick modifications.

  • On about line 40, you should see two commands just before it where BigFix places your archive file as well as your bat file that you created that’ll look like this:
  • Find the right line here:

  • That is where we’ll put in a few extra lines here to get the desired result out of the job. Here are the lines you’ll want to add: (first line is just a comment line)

//Extract archive folder and delete existing folder and create new one
extract FolderIwantToSendArchive
delete "C:\Windows\Temp\FolderSendBES"
folder create "C:\Windows\Temp\FolderSendBES"        

  • You’ll want to customize the above to match the name of the archive file you want to extract, clearing the path for the folder to be created and the new folder to be created.
  • Should look something like this:

  • Once you're done with your edits, customize the name so it makes sense for what you're doing and then click "OK".

  • That is all you need to customize. Once you have those items in place you should be able to test as needed. Don’t forget to set the relevance criteria for the job so you don’t accidentally try to send items with windows pathing to a linux box!
  • Little note of explanation: What exactly is happening is essentially we're using native compression utilities within BigFix to compress the folder to something we can easily send, then once it is sent, extract it again. Then we're leaning on a .bat file and the method it is called to place it after we use BigFix to clear and create the path where it is going to be placed. This helps get through some of the permission problems we'll run into do it any other way.
  • Here is what the final result will look like:

  • Take action and test the mileage:

  • The above is the evidence of it working. As you can see, the folder was placed in the directory I wanted it to end up in with even a little test file there. Obviously if you're wanting to play a bit with the folder structures a bit you just take out a bit of layering to the folders or add depending on what you're trying to do. End result for the console side will look like this:

  • And that's it!

Nikita Rudnev

IT Specialist At Passportcard Labs

7 个月

Thanks for sharing

回复
Rameshwar Prasad

AVP - Information Technology - Xchanging

7 个月

Thanks for sharing this. I think using the software distribution wizard selecting the complete folder is easy way with destination folder option modifified in task wherever you want?

回复
Uche Onyegbule

CISSP | CCSP | IAM | PreSales| Helping organizations mitigate risks and establish Digital identity trust across users, applications, and data.

7 个月

Thanks for sharing David Finnie, I usually use the software distribution wizard in the BigFix Console to do this. Rather than selecting an application, there is an option to select a folder and BigFix automatically archives it and generates the prefetch command. You can then use the "extract (__Downloads/archiveFileName) ( location you intend to place the folder e.g.C:\Temp)". I've used this method to transfer folders and subfilders with their respective file contents, e.g. specific drivers, custom tools, etc.

Dave Langridge

BigFix L2 Support Lead - USA at HCL Technologies

7 个月

Very cool use case

Ken Vendler

BigFix Technical Advisor at HCL Software

7 个月

Thanks for sharing the fruits of your labor, David Finnie!

要查看或添加评论,请登录

David Finnie的更多文章

  • BigFix Troubleshoot - BFIVR - IVR Data Not Found

    BigFix Troubleshoot - BFIVR - IVR Data Not Found

    Running into IVR Data Not Found Error? Here is what has caused this for you, and after that, the fix. Luckily, if you…

    6 条评论

社区洞察

其他会员也浏览了