Setting Multiple profile in Cisco AnyConnect – Windows

I have been using the Cisco AnyConnect as my primary VPN Client for the past few months. The simple view of the client is really impressive and productive.

Whenever I want to connect to my VPN host I will type my VPN host address in the text of VPN client and click connect. It’s pretty easy when we are using only one VPN profile. It will remember our last used setting/profile details with it.

But when I need to switch to another VPN network, I have to delete the VPN host address and retype the new VPN host address. I have searched on the Internet and found how to set the multiple profiles in VPN client.

To set multiple profiles in Cisco AnyConnect VPN client. We have to add an XML config file with name “Profile.xml”

The file has to be placed in the following path

C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile

Profile.xml

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
<ServerList>
<HostEntry>
<User>username</User>
<HostName>host alias name</HostName>
<HostAddress>host address of vpn</HostAddress>
</HostEntry>
</ServerList>
</AnyConnectProfile>

We have to provide our VPN details inside the HostEntry tag which is under ServerList.

whereas

<User> is username of our VPN account

<HostName> is our alias name of profile

<HostAddress> is URL of VPN host or IP address

Example

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
<ServerList>
<HostEntry>
<User>Pandiyan</User>
<HostName>MyHost</HostName>
<HostAddress>local.pandiyan.com</HostAddress>
</HostEntry>
</ServerList>
<ServerList>
<HostEntry>
<User>Guest</User>
<HostName>MyGuest</HostName>
<HostAddress>guest.pandiyan.com</HostAddress>
</HostEntry>
</ServerList>
</AnyConnectProfile>

Once we have added the profile config file, we have to restart our VPN client instance. Once we restarted the VPN client will look as follows

Cisco

We can able to choose our profile from the drop down, and when we try to load our profile the username will be auto filled using the value of User field in the config file.

MyHost

I have tried these setting on my Windows 10 machine. It’s working fine for me, you guys try out and let me know your feedback in comment section.

 

Happy Working!

Destructuring

The destructuring assignment syntax is a JavaScript expression that makes it possible to extract data from arrays or objects into distinct variables.

Object Destructuring

In ECMAScript 5 and earlier, it would take lots of code to extract information from array and objects.

var username = {
    firstName: 'Pandiyan',
    lastName: 'Murugan'
};

var firstName = username.firstName;
var lastName = username.lastName;

console.log(firstName + ' ' + lastName);

Object destructuring syntax uses an object literal on the left side of an assignment operation.

In ECMAScript 6,

var username = {
    firstName: 'MS',
    lastName: 'Dhoni'
};

var {firstName, lastName} = username;

console.log(firstName + ' ' + lastName);

In the above example, username.firstName is stored in firstName and username.lastName is stored in lastName.

var username = {
    firstName: 'MS',
    lastName: 'Dhoni'
};

var { firstName, lastName, designation } = username;

console.log(firstName + ' ' + lastName + ' ' + designation);

// designation will be undefined at this point

We can set default values as follows

var username = {
    firstName: 'MS',
    lastName: 'Dhoni'
};

var { firstName, lastName, designation = 'player' } = username;

console.log(firstName + ' ' + lastName + ' ' + designation);

// designation will be set as player if it didn't find the value for player in username object

Assigning to Different Local Variable Names

In an earlier example, we have used same in the local variable with matching the name in the object. Now let’s try to assign it to different variable as follows

var username = {
    firstName: 'MS',
    lastName: 'Dhoni'
};

var {  lastName: localLastName, firstName: localFirstName } = username;

console.log(localFirstName +' '+ localLastName);     // MS Dhoni

Here we can use any order to assign the variables. The values will be properly set.

Array destructuring

Array destructuring syntax is very similar to object destructuring; it just uses an array literal syntax instead of object literal syntax.
The destructuring operates on positions within an array, rather than the named properties that are available in objects.

var fruits = [
    'mango',
    'banana',
    'jack fruit'
];

var [fruitOne, fruitTwo, fruitThree] = fruits;

console.log(`${fruitOne} ${fruitTwo} ${fruitThree}`);

Setting default values in an array literal is similar to object literals.

Let’s cover more ES6 features in an upcoming post. Keep reading and supporting.

Happy coding 🙂