Problem
I’ve configured the Windows Task Scheduler on my Server to run a PowerShell Script. However, the Windows Task Scheduler Fails to run with error code 2147943785. Below the error detail that I got:
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <System> <Provider Name="Microsoft-Windows-TaskScheduler" Guid="{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}" /> <EventID>101</EventID> <Version>0</Version> <Level>2</Level> <Task>101</Task> <Opcode>101</Opcode> <Keywords>0x8000000000000001</Keywords> <TimeCreated SystemTime="2019-05-01T19:45:49.177538800Z" /> <EventRecordID>194892</EventRecordID> <Correlation ActivityID="{2B3B1F12-FB23-0000-41F8-4F2B23FBD401}" /> <Execution ProcessID="800" ThreadID="3596" /> <Channel>Microsoft-Windows-TaskScheduler/Operational</Channel> <Computer>AD5.msnoob.com</Computer> <Security UserID="S-1-5-18" /> </System> - <EventData Name="TaskStartFailedEvent"> <Data Name="TaskName">\msExchHideFromAddressLists</Data> <Data Name="UserContext">msnoob\user1/Data> <Data Name="ResultCode">2147943785</Data> </EventData> </Event>
Solution
The user that is configured to run the task scheduler must have “Log on as a batch job” rights on the computer. You can configure this on the local security policy of the computer or using GPO. The “Log on as a batch job” policy location is under
Security Setting -> Local Policies -> User Rights Assignment -> Log On As Batch Job
Don’t forget to update the policy using GPUPDATE /Force if you set this policy on GPO.
If you like this article, please share, subscribe or you can follow our Facebook Page and Twitter.