Always getting error 720 during vpn dial out

Aug 31, 2015 at 2:26 PM
I have a windows server 2012 R2 with "Route and remote access" configured. In this simple configuration there is a dialer connection to a vpn as you can see in the first picture..

Image

So, if i click connect.. everything works fine and the status of the network interface changes from disconnected to connected. Going to the event viewer this is what i got:

Events from RASCLIENT sourcelog:

Event 1:
CoId={A52088DC-5358-44D6-8B77-DA49516C3FBD}: The user SYSTEM has started dialing a VPN connection using a all-user connection profile named VpnAtlanta02. The connection settings are: 
Dial-in User = c******s
VpnStrategy = PPTP
DataEncryption = Require
PrerequisiteEntry = 
AutoLogon = No
UseRasCredentials = Yes
Authentication Type = MS-CHAPv2 
Ipv4DefaultGateway = No
Ipv4AddressAssignment = By Server
Ipv4DNSServerAssignment = By Server
Ipv6DefaultGateway = Yes
Ipv6AddressAssignment = By Server
Ipv6DNSServerAssignment = By Server
IpDnsFlags = 
IpNBTEnabled = No
UseFlags = Private Connection
ConnectOnWinlogon = No.
Event 2:
CoId={A52088DC-5358-44D6-8B77-DA49516C3FBD}: The user SYSTEM is trying to establish a link to the Remote Access Server for the connection named VpnAtlanta02 using the following device: 
Server address/Phone Number = ***.***.***.***
Device = WAN Miniport (PPTP)
Port = VPN3-4
MediaType = VPN.
Event 3:
CoId={A52088DC-5358-44D6-8B77-DA49516C3FBD}: The user SYSTEM has successfully established a link to the Remote Access Server using the following device: 
Server address/Phone Number = ***.***.***.***
Device = WAN Miniport (PPTP)
Port = VPN3-4
MediaType = VPN.
Event 4:
CoId={A52088DC-5358-44D6-8B77-DA49516C3FBD}: The link to the Remote Access Server has been established by user SYSTEM.
Event 5:
CoId={A52088DC-5358-44D6-8B77-DA49516C3FBD}: The user SYSTEM has dialed a connection named VpnAtlanta02 to the Remote Access Server which has successfully connected. The connection parameters are:
TunnelIpAddress = 172.20.0.19
TunnelIpv6Address = None
Dial-in User = c******s.
Now.. my goal is to get connected from a windows service

So here is my code (the essential part):
Dialer = new RasDialer();
Dialer.PhoneBookPath = "C:\\Windows\\System32\\ras\\Router.pbk";
Dialer.Timeout = 20 * 1000;
Dialer.HangUpPollingInterval = 20 * 1000;
Dialer.AllowUseStoredCredentials = false;
Dialer.AutoUpdateCredentials = RasUpdateCredential.None;
Dialer.EntryName = "VpnAtlanta02";
Dialer.Credentials = new System.Net.NetworkCredential("c******s", "*********");
Watcher = new RasConnectionWatcher();
Watcher.EnableRaisingEvents = true;
Watcher.Connected += Watcher_Connected;
Watcher.Disconnected += Watcher_Disconnected;
InfoLog("Begin connection");
Watcher.Handle = Dialer.Dial();

private void Watcher_Disconnected(object sender, RasConnectionEventArgs e)
{
    InfoLog(e.Connection.EntryName + " is disconnected");
}

private void Watcher_Connected(object sender, RasConnectionEventArgs e)
{
    InfoLog(e.Connection.EntryName + " is connected");
}
Sofar, no matter what... going to the event viewer looking for the RasClient event source, as expected i got 5 events logged. 1,2,3 and 4 are equal to the ones generated by the manual connection unfortunately the last (5) is:
CoId={E2814072-13C7-44CF-998A-A1160FDC86E3}: The user SYSTEM dialed a connection named VpnAtlanta02 which has failed. The error code returned on failure is 720.
Any suggestions, ideas will be very appreciated.

Thanks in advance.

Cecco
Editor
Sep 9, 2015 at 2:28 PM
I'm no expert on these things (e.g., built in VPN clients), but isn't it the case that SYSTEM cannot present anything other than anonymous credentials to network resources? Could that have something to do with it?
Sep 9, 2015 at 2:50 PM
Well.. I highly doubt it!
I asked first on stackoverflow.
As you can see, on that question i pointed out what would happened in the case of using wrong credentials. Anyway, i solved my problem in a different way without DotRas. I decided to not reply here because i thought it would have been out of topic.