Recently I had an interesting issue to resolve. We are deploying a new website with a soft launch within the company. We needed anyone on the office network to redirect our old website to the new website using DNS. The problem was that users that were working remotely would still see the old website when they are on VPN. When our users are using VPN, their DNS is being controlled by the network they are using instead of the VPN adapter. That caused them to always view the old website instead of the new website.

So… What did we need to do? We need to change the settings in the VPN adapter to use the DNS from the VPN adapter instead of the NIC adapter. Great! That’s easy, we can just open the Barracuda VPN Client and change the setting “Automatically prioritize VPN adapter” to “Yes”. Well, our end users are not local administrators on their workstations, which means that we would have to remote into every workstation and complete the change. We needed to run a script to change that setting.

What I ended up doing was running RegistryChangesView and captured a snapshot of the current registry. I then made the change on the Barracuda VPN Client. I then took another snapshot of the registry and saw that there was a registry key that was modified. I went to that registry key and changed it. The setting was also changed on the VPN client.

Now we need to find a way to create a script to change the setting and deploy it to all the workstations. This is where we use PowerShell to execute the modification of the registry key. The key was located in the following location:

The script I ended up using was and deploying with SCCM was:

SCCM deploys the PowerShell script and it modifies the setting in Barracuda VPN client. Running this script we were able to change the setting for all workstations without any action required from the end users. Now when users that are using VPN navigate to our current website, it will forward them to the new website through our internal DNS.

VPN – Virtual Private Network
DNS – Domain Name System
NIC – Domain Name System
SCCM – System Center Configuration Manager

Leave a Reply