Force AnyConnect to remember profiles

Cisco AnyConnectI have quite a number of client systems I need to connect to using VPNs. While there is a large number of VPNs available, it is inevitable that I would have some used by more than one client. One such as Cisco AnyConnect.

By default AnyConnect will remember only the last VPN to which you connected, but it is possible to force it to remember multiple connections by adding a Profile.xml to the Profile folder located in C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile.

The xml file can contain a HostName and HostAddress (prior versions supported a User) which means I don’t have to look up the URL or IP address of a connection everytime I want to connect.

The XML file should contain the following:

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
<ServerList>
     <HostEntry>
          <HostName>Connection 1</HostName>
          <HostAddress>162.168.1.125</HostAddress>
     </HostEntry>
</ServerList>
<ServerList>
     <HostEntry>
          <HostName>Connection 2</HostName>
          <HostAddress>192.168.1.152</HostAddress>
     </HostEntry>
</ServerList>
</AnyConnectProfile>

With the connection information saved into the xml file, you’ll be able to access them through a drop down list in AnyConnect.

The information above is based on this post by Pandiyan Murugan; I’m reposting so that I can find it easily.

Changing The Cisco AnyConnect Default Host Name

Microsoft Dynamics GPWe use Cisco AnyConnect at internally at work and for a number of clients. I use the internal VPN a lot more often than connecting to the clients who also use AnyConnect.

Unfortunately, the work VPN is the one which AnyConnect does not remember. There may be a way to have AnyConnect remember more than one, but for now I’d settle for being able to change the Default Host Name.

Well, fortunately, there is a preferences.xml file which can be amended. The file can be found in the following location (replace the highlighted section with your username):

C:\Users\{username}\appdata\local\cisco\Cisco AnyConnect Secure Mobility Client

Find the following line and you can replace thie highlighted section with the address you want to have as the default:

<DefaultHostName>{hostname}</DefaultHostName>