Working with Custom Packages Involving Scripts

BMC Client Management has three methods of distributing packages to computers on the network:

  • Custom Package
  • MSI Package
  • Snapshot Package

MSI Packages allow you to work with an MSI File within the graphic interface of Client Management, and a snapshot package creates a package based on changes from a device as recorded by its agent.
With a custom package, you have the flexibility to be able to perform a rollout of an Executable with its proper switches to the devices.

While you can use a batch file for some of the options that you can use when deploying a package, it is not a bad idea to learn how to use Custom Packages past the use of a batch file.
For example, you can set up an MSI deployment from a custom package by running
the following command:
C:\Windows\System32\msiexec.exe /I “C:\File\Install.msi” /q
This command will execute the file Install.msi in quiet mode. This will cause the file to execute silently with no user interaction. Other MSI Command options can be used and found on the Microsoft website.

But what if you wanted to run a command other than an MSI, like a .vbs script? You would need to run a different command:

C:\Windows\System32\cscript.exe “C:\File\Install.vbs”
It is also possible that you may want to run a patch from Microsoft outside of Patch Management, or you may not have the Patch Management Module, but your client management is licensed for Software Deployment, you can use the following command to deploy patches:

C:\Windows\System32\wusa.exe “C:\File\PatchFile.msu”
We are going to build a package that will contain a VBS Script with a simple Hello Message that is going to run on the remote computer.

  1. Open and log in to your Client Management (Asset Core) Console.
  2. Click on the Wizards menu and select Package Creation.
  3. Make sure that Custom Package is selected towards the bottom and click next.
  4. Name the package. Make sure to check the options that you would need for this installation, including possible “Run as Options”, “Installation Options” and “Add Files”. Click Next
  5. In the installation options, you will set the destination path for the system to extract the file to when it reaches the remote machine. I this example we use the C:\Temp folder as the path for the install.vbs file to be extracted to. In the Run command line make sure to enter the following command:
  6. C:\Windows\System32\cscript.exe “C:\Temp\Install.vbs”
    1. We are now going to add the script to the package. Simply browse to the location of the file, I prefer to have a C:\Temp Folder in my package factory computer with the files that I wish to deploy. That way these can be deployed to other devices accordingly. Make sure to disable “Enable Full Path” unless on the remote devices these do not have a C:\Temp folder, or the folder location where you wish to drop the files out of.
    2. Once the file has been collected, Publish to the Master Server.
    3. A new window will appear after finishing the package creation wizard asking whether to create an Operational Rule or Deploy the package. Make sure to select Deploy the Package for this testing.
    4. A new Wizard will appear that will take care of the distribution of the package. You can select a Device Group if you wish, but for now, we are going to test on one device. Change the Target Type drop-down to Devices. Click Next.
    5. Assign the Device you wish to deploy and click Finish

In this example what should happen is the package is going to be deployed on the C:\Temp folder and it will execute a VBS Script that will show a Hello Message on the Screen.
This is just a small sample of what you can do with a Custom Package. You can build a VBS script with multiple things to do on a computer be deployed using Client Management’s Software Distribution Module to execute on all of your remote devices. These are executed using the Local System Account.


Submit a Comment

Your email address will not be published. Required fields are marked *