Shell Script to Install Cisco Anyconnect VPN via Intune

There is an excellent article talks about how to deploy the Cisco Anyconnect VPN client via Intune:

Basically :

  1. Add Cisco Team Identifier (DE8Y96K9QP)and Bundle Identifier( into the System Extension Profile inside Intune;
  2. Add WebContentFilter profile;
  3. Configure Install Choice XML file(by default, the Cisco AnyConnect VPN DMG file installs every component, with this configuration XML file, you can specify which component to install);
  4. Cisco AnyConnect profile( to set the configurations and VPN server info during the installation);
  5. Deploy the Cisco AnyConnect client package

Here is my shell script to download the PKG file, installation choice XML file, and XML profile injection.

# Cisco Anyconnect VPN Client Install
# Rui Qiu
# 20230201

if [[ $EUID -ne 0 ]]; then
    echo "This script must be run as root"
    exit 1

cd /tmp
curl -o ./AnyConnect.pkg
curl -o ./vpn.xml
curl -o ./vpninstallchoice.xml
installer -pkg AnyConnect.pkg -applyChoiceChangesXML vpninstallchoice.xml -target /
cp -f /tmp/vpn.xml /opt/cisco/anyconnect/profile/

rm ./AnyConnect.pkg
rm ./vpn.xml
rm ./vpninstallchoice.xml

Leave a Comment