1

I have a scheduled task with a condition set to "Start only if the following network connection is available". I've selected my VPN connection.

However, even when my VPN is connected the task will fail to start.

Task Scheduler failed to start "\Backups\Test" task for user "MYDOMAIN\administrator". Additional Data: Error Value: 2147750692.

Task Scheduler could not start task "\Backups\Test" because the network was unavailable. User Action: Ensure the computer is connected to the required network as specified in the task. If the task does not require network presence, remove the network condition from the task configuration.

Any idea why it isn't detecting the network connection availability? I'm lost.

More details

  • This is a Windows VPN connection, no 3rd party VPN software involved.
  • I'm logged into the machine and logged onto the VPN when the task tries to run.
  • My VPN connection is definitely working, pings and such work fine.

Exported Task XML

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2013-12-10T19:46:08.1423901</Date>
    <Author>MYDOMAIN\administrator</Author>
    <Description>Upload backup files to the network.</Description>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2013-12-10T12:00:00</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
    <TimeTrigger>
      <StartBoundary>2013-12-11T12:54:01</StartBoundary>
      <Enabled>true</Enabled>
    </TimeTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>MYDOMAIN\administrator</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>true</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
    <NetworkSettings>
      <Name>My VPN Connection</Name>
      <Id>{3148EF2F-A10A-4A00-BB87-98A995247E4C}</Id>
    </NetworkSettings>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\upload-backup.cmd</Command>
    </Exec>
  </Actions>
</Task>
17
  • What kind of VPN connection are you using?
    – squillman
    Dec 11, 2013 at 19:29
  • It's a standard Windows VPN connection. No 3rd party VPN client involved. Dec 11, 2013 at 19:39
  • Is the VPN running under the same account as the scheduled task? Are you trying to run the task without being logged on or are you logged in to the desktop? Can you manually run it?
    – TheCleaner
    Dec 11, 2013 at 19:55
  • Manually running the task works. A manual trigger appears to bypass the condition entirely. I'm the only user logged into the machine and the VPN is connected in my session. Dec 11, 2013 at 20:05
  • Yes, @user2196728 ... that's kind of the basis for the whole issue. Dec 11, 2013 at 20:17

2 Answers 2

1

Late but better than never... I was dealing with the same issue and (at least in my case) it seems to be timing related. It seems that after you establish such VPN connection, it takes few seconds (usually between 5-10) before the task manager is able to determine that the related network connection is available.

So by experimenting a little I found the minimum delay with which the task is pretty much reliably started, then added 1 more second to the delay just to be sure and that's how I use it now. It isn't ideal since that delay isn't something that makes it really comfortable to use, but it really works.

So the main point is - try to delay the task execution a little.

0

My experience is that, regardless of how the fault arises, this fault can be overcome by un-checking the condition "start only if the following network connection is available".

If you are on a broadband always-on connection, it should not be necessary to test for the presence of the internet connection.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .