Windows 任务计划程序不会运行 powershell.exe

Windows 任务计划程序不会运行 powershell.exe

我是一名具有 Linux 管理背景的安全工程师,正在尝试自学有关 Windows Server 2016 Preview 5 和 Windows 10 Enterprise 评估版上的 GPO。我创建了一个即时任务来运行 PowerShell 脚本。

当任务尝试执行时,我在事件查看器中收到此警告:

任务计划程序服务在 NT TASK\EMET 5.51 定义中发现配置错误。附加数据:错误值:powershell.exe。

我读到的所有内容都表明这应该可行。我做错了什么?

以下是 XML 格式的任务:

<?xml version="1.0" encoding="utf-8"?>
<ScheduledTasks clsid="{CC63F200-7309-4ba0-B154-A71CD118DBCC}">
    <ImmediateTaskV2 clsid="{9756B581-76EC-4169-9AFC-0CA8D43ADB5F}" name="EMET 5.51" image="0" userContext="0" removePolicy="0" changed="2016-08-14 19:45:32" uid="{1CA5AB58-B38C-4F73-944F-9CDCBBF57037}">
        <Properties action="C" name="EMET 5.51" runAs="BYTHEBIT\Administrator" logonType="InteractiveToken">
            <Task version="1.2">
                <RegistrationInfo>
                    <Author>BYTHEBIT\Administrator</Author>
                    <Description></Description>
                </RegistrationInfo>
                <Principals>
                    <Principal id="Author">
                        <UserId>BYTHEBIT\Administrator</UserId>
                        <LogonType>InteractiveToken</LogonType>
                        <RunLevel>HighestPrivilege</RunLevel>
                    </Principal>
                </Principals>
                <Settings>
                    <IdleSettings>
                        <Duration>PT5M</Duration>
                        <WaitTimeout>PT1H</WaitTimeout>
                        <StopOnIdleEnd>false</StopOnIdleEnd>
                        <RestartOnIdle>false</RestartOnIdle>
                    </IdleSettings>
                    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
                    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
                    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
                    <AllowHardTerminate>false</AllowHardTerminate>
                    <StartWhenAvailable>true</StartWhenAvailable>
                    <AllowStartOnDemand>false</AllowStartOnDemand>
                    <Enabled>true</Enabled>
                    <Hidden>false</Hidden>
                    <WakeToRun>true</WakeToRun>
                    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
                    <Priority>7</Priority>
                    <DeleteExpiredTaskAfter>PT0S</DeleteExpiredTaskAfter>
                </Settings>
                <Actions Context="Author">
                    <Exec>
                        <Command>powershell.exe</Command>
                        <Arguments>-NoProfile -NoLogo -NonInteractive -ExecutionPolicy Bypass -File \\DC\Shared\Deployment\deployment.ps1</Arguments>
                    </Exec>
                </Actions>
                <Triggers>
                    <TimeTrigger>
                        <StartBoundary>%LocalTimeXmlEx%</StartBoundary>
                        <EndBoundary>%LocalTimeXmlEx%</EndBoundary>
                        <Enabled>true</Enabled>
                    </TimeTrigger>
                </Triggers>
            </Task>
        </Properties>
        <Filters><FilterRunOnce hidden="1" not="0" bool="AND" id="{C58ADBD5-837B-46E8-98E4-80703D52F20E}"/>
        </Filters>
    </ImmediateTaskV2>
</ScheduledTasks>

相关内容