简体   繁体   English

脚本未从Windows Server 2012 R2上的任务计划程序运行

[英]Script not running from task scheduler on Windows Server 2012 R2

I have a Python script that needs to run nightly on several servers. 我有一个Python脚本,该脚本需要在多台服务器上每晚运行。 I set up a scheduled task which runs on Windows Server 2008, but not on Windows Server 2012 R2. 我设置了计划任务,该任务在Windows Server 2008上运行,但不在Windows Server 2012 R2上运行。 Originally, it was running as myself, but on 2012R2, it only runs when I'm logged in. I've tried running as a domain admin user and as the local SYSTEM account, but no luck. 最初,它以我自己的身份运行,但是在2012R2上,它仅在登录后运行。我尝试以域管理员用户和本地SYSTEM帐户身份运行,但没有运气。 I've tried both setting a starting path to C:\\Temp and leaving it black. 我尝试过将C:\\ Temp的起始路径设置为黑色。 I've tried running with highest privileges. 我尝试以最高特权运行。 Here is the exported task from my most recent test. 这是我最近测试中导出的任务。

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2018-04-17T13:29:35.5882266</Date>
    <Author>SYSTEM</Author>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2018-04-17T07:22:00</StartBoundary>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-18</UserId>
      <RunLevel>HighestAvailable</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
    <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\Python27\python.exe</Command>
      <Arguments>-m ecs_capacity</Arguments>
      <WorkingDirectory>C:\Temp</WorkingDirectory>
    </Exec>
  </Actions>
</Task>

Running this while not logged on results in this: 在未登录的情况下运行它会导致以下结果:

Task Scheduler successfully completed task "\ECS Capacity Reports (ADM)" , instance "{168f0587-2c93-49c5-9913-a70d70346630}" , action "C:\Python27\python.exe" with return code 2147942401.

Things I've already looked at: 我已经看过的东西:

I never found an answer to this, so I'm biting the bullet and moving my script over to a Linux server where I can use cron. 我从来没有找到答案,所以我很努力,将脚本移到可以使用cron的Linux服务器上。 Sorry, Microsoft. 抱歉,微软。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows Server 2008 R2任务计划程序 - Windows server 2008 r2 Task Scheduler Windows Server 2012 R2-高CPU /内存使用率导致任务计划程序无法运行? - Windows Server 2012 R2 - High CPU / Memory Usage Causes Task Scheduler to Not Run? 在Windows Server 2012 R2中手动和自动运行任务之间的差异 - Diffrence between running task manually and automatically in Windows Server 2012 R2 Windows Server 2008 R2 32位任务计划程序 - Windows Server 2008 R2 32-bit Task Scheduler 使用 Windows 任务调度程序和 xampp 服务器运行具有 curl 的 php 脚本 - running php script featuring curl with windows task scheduler and xampp server Windows 2012 R2服务器下的imagepng - imagepng under a Windows 2012 R2 Server Windows Server 2012 R2中的Virtualbox错误 - Windows Server 2012 R2 in Virtualbox error 当触发器选项设置为启动时,Windows 任务计划程序未在 Windows Server 2012 中运行 - Windows task scheduler is not running in Windows server 2012 when trigger option is set as Startup Microsoft Server 2008 R2不从任务计划程序写入文本文件 - Microsoft Server 2008 R2 not writing to text file from task scheduler 登录失败:Windows Server 2012 R2 上用于远程 PS 脚本执行的未知用户名或密码错误 - Logon failure: unknown username or bad password error on Windows Server 2012 R2 for Remote PS script execution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM