Question

Create a worklet that installs two programs and pushes a xml profile

  • 30 August 2023
  • 4 replies
  • 142 views

Badge

Hello,

I’m looking for guidance to create a worklet that will install Cisco secure client core VPN and Cisco Umbrella  as well as pushing an xml profile to the end point destination “C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile”. The goal is to push this software while the end point is not connected to the company network, but rather through the Automox agent. Is this feasible to do? if so, how do I accomplish this?

 

Programs:

Windows Installer Package (.msi)

cisco-secure-client-win-5.0.03076-core-vpn-predeploy-k9

cisco-secure-client-win-5.0.03076-umbrella-predeploy-k9

 

Endpoints are Windows 10/11


4 replies

Userlevel 3
Badge

You’re looking at an interesting solution! 
I haven’t built & tested, but just spitballing a way I can see it working. 

New Worklet Policy
EVALUATION 

  1. Check if VPN client is already installed.
    1. If installed - check for .XML files
      1. If .xml is missing - run Configure (2nd phase of remediation script)
      2. if .xml is present - Don’t run
    2. If not - Run install & configure (Entire Remediation script)

REMEDIATION

  1. Extract contents of .zip folder (containing MSI & 2 XML files)
  2. install VPN client app
  3. Clone XML files to desired location
Userlevel 3
Badge

AI Generated code!! 
USE AT YOUR OWN RISK! - please utilize this as a guide/inspiration for your own script creation. 

EVALUATION


# ======================
# Otto AI Generated Code
# ======================
# Define the path to the ProgramData folder
program_data_folder="C:\ProgramData"

# Define the name of the app folder
app_folder_name="<app_folder_name>"

# Define the names of the XML files
xml_file1_name="<xml_file1_name>.xml"
xml_file2_name="<xml_file2_name>.xml"

# Check if the app folder exists
if [ -d "$program_data_folder/$app_folder_name" ]; then
echo "App folder exists."

# Check if the first XML file exists
if [ -f "$program_data_folder/$app_folder_name/$xml_file1_name" ]; then
echo "First XML file exists."
else
echo "First XML file does not exist."
fi

# Check if the second XML file exists
if [ -f "$program_data_folder/$app_folder_name/$xml_file2_name" ]; then
echo "Second XML file exists."
else
echo "Second XML file does not exist."
fi
else
echo "App folder does not exist."
fi


REMEDIATION

 


# ======================
# Otto AI Generated Code
# ======================
# Define the path to the zip folder
zip_folder_path="<zip_folder_path>"

# Define the path to the destination folder for the extracted files
extracted_files_folder="<extracted_files_folder>"

# Define the path to the MSI file
msi_file_path="<msi_file_path>"

# Define the paths to the destination folders for the XML files
xml_file1_destination="<xml_file1_destination>"
xml_file2_destination="<xml_file2_destination>"

# Extract the files from the zip folder
unzip "$zip_folder_path" -d "$extracted_files_folder"

# Run the MSI installer
msiexec /i /<installation_arguments> "$msi_file_path"

# Move the XML files to desired locations
mv "$extracted_files_folder/xml_file1.xml" "$xml_file1_destination"
mv "$extracted_files_folder/xml_file2.xml" "$xml_file2_destination"

 

Badge

Hi David! This is great, The only thing is that your code is for 1 MSI & 2 XML files. I need 2 MSI and 1 XML. This is a fantastic start for me though. Thank you!

Userlevel 3
Badge

Oh yeah I wouldn’t throw any of this into production without fleshing it out more. 
SHAMELESS PRODUCT FEATURE PLUG - We have an AI Scripting Tool by Automox

It’s a gamechanger in quickly figuring out the starting points and beginning the journey of solving these more complex problems. 

I’d love to see how far you get with this one, VPN configuration and deployment can be messy. I’m happy to promote these kind of use-cases for permanent additions to the catalog. 

Reply