On windows 7, looking for Registry Key or non-gui command to Change "Use Default gateway on Remote network"

1

Does anyone know of the Registry Key that is used to turn on or off "Use Default gateway on Remote Network" ? I need to automate this change for many computers and want to avoid the GUI method of doing this ( see https://documentation.meraki.com/MX-Z/Client_VPN/Configuring_Split-tunnel_Client_VPN )

Peter

Posted 2016-02-01T21:29:30.873

Reputation: 13

Answers

0

It's not stored in a registry key, it's stored in the RAS phone book.

The good news is, it's in a human-readable/editable file.

Head to C:\Users\<UserName>\Application Data\Microsoft\Network\Connections\Pbk, and edit the rasphone.pbk in a text editor (like say, Notepad).

Find the section that's header matches the name of the VPN contention you'd like to modify, and then change IpPrioritizeRemote=1 to IpPrioritizeRemote=0 to disable using the remote gateway.

To actually edit it via a script, PowerShell is probably easiest.

To get you going, here's a PowerShell (v2+) command that will update all VPNs in the PBK to NOT use the remote gateway, and then re-save the file (run it from the folder that contains the PBK file you want to update, or add absolute paths).

(Get-Content .\rasphone.pbk) -replace 'IpPrioritizeRemote=1', 'IpPrioritizeRemote=0' | Set-Content .\rasphone.pbk

Ƭᴇcʜιᴇ007

Posted 2016-02-01T21:29:30.873

Reputation: 103 763

0

You can use Powershell to enable/disable the "Use default gateway on remote network" option:

turn on:

Set-VpnConnection -Name "myVPN" -SplitTunneling $True

turn off:

Set-VpnConnection -Name "myVPN" -SplitTunneling $false

You adjust tweak this a bit so it will run on several machines supplied by you, or configure a startup-script that will enable/disable the setting at startup.

Smeerpijp

Posted 2016-02-01T21:29:30.873

Reputation: 1 004

1

Thanks, that's helpful, but I think this Powershell Cmdlet is only available for Win 8 and Windows 2012 or later, link

– Peter – 2016-02-02T20:46:26.510