Install software depending on computername

We use a naming scheme at work for our computers. The name starts with (L for laptop, D for desktop, M for mac) and then the asset tag for the device.

We are in the process of setting up AnyConnect for our users and need to check if it is installed and install it it if it is not.

So I’m thinking check if the computername starts with “L” (case doesn’t matter) and then check if AnyConnect is installed. If not, then install and copy the XML file to the location for the settings file goes.

The XML file would be copied to C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile after the program installs.


It’s possible. we started working with your Script, will get back to you soon with good result.

Thank you.

Hi @zabolyx

Please refer the script for installing “anyconnect” software depending on the computer name. If the name starts with D/d or L/l, script will proceed otherwise it says "computer is not in the working scheme"We have attached the script for installing the software on windows(desktop and laptop) & MAC device separately.

For windows,
Refer the attached json file,

For mac device ,

script which need to run in the terminal is given below.

Save this code as “” format and run the code using following command.
Example : “sudo sh”.

In this script you can modify the parameter

Edit parameters:
“url=” #as your need before running the script.

url="" #change url as your need
if [ -d /Applications/Cisco ]
    echo "Cisco Anyconnect is  installed."
    echo "any connect is not installed"
    curl -O $url
    hdiutil attach anyconnect-macosx-i386-3.1.13015-k9.dmg
    cp -r /Volumes/"AnyConnect 3.1.13015" /Applications
    installer -pkg /Applications/"AnyConnect 3.1.13015"/Anyconnect.pkg -target / -allowUntrusted
    rm -r /Applications/"AnyConnect 3.1.13015"
    hdiutil detach /Volumes/"AnyConnect 3.1.13015"

20171219-windows-anyconnect.json (9.52 KB)