Windows – How to set the Network Location for an incoming VPN Connection in Windows 8

network-locationvpnwindows 8

I'm using Windows 8's Incoming Connections feature to run a PPTP VPN server within my network.

The VPN works perfectly fine, except that remote computers cannot connect to the VPN host itself.

I can ping and connect to all other computers in my local network, but I can't even ping the internal IP address of the VPN host (which is also a file share)

On Windows 7, I solved this issue by setting the network location of the VPN's RAS (Dial In) Interface (on the host machine) to Private.

However, on Windows 8, it defaults to Public, and I can't find any place in the UI to change it. Network locations are now set in the Modern UI Network List, which doesn't show the incoming connection.

Best Answer

Run the following PowerShell commands:

$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
$networkListManager.GetNetworks(3) | Where-Object { $_."GetName".Invoke(@()) -eq "RAS (Dial In) Interface" } | % { $_.SetCategory(1) }

The first command creates a NetworkListManager object.
The second command consists of three parts (separated by |s):

  • The first part lists all registered networks
  • The second part filters that list for networks with a specific name.
    (remove the third part to see the results of the filtering)
  • The third part sets the network location for all matching networks. 0 is public; 1 is private.

For more (technical) information, see the Network List Manager API documentation.

Related Question