Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm trying to schedule my C# program to run on Windows scheduler. I'm using, Windows 7 Professional.
I can create the task security options set to run whether or not the user is logged in, gave it high privileges, it is to launch an exe on a remote path which I have access to.
"Error Value: 2147943785" your help would be much appreciated.
Here's the XML for the error
- <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="2013-01-10T12:44:20.882178000Z" />
<EventRecordID>51522</EventRecordID>
<Correlation />
<Execution ProcessID="652" ThreadID="1892" />
<Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
<Computer>pcb.co.za</Computer>
<Security UserID="S-1-5-18" />
</System>
- <EventData Name="TaskStartFailedEvent">
<Data Name="TaskName">\Naedo</Data>
<Data Name="UserContext">Domanin\User31r</Data>
<Data Name="ResultCode">2147943785</Data>
</EventData>
</Event>
The user that is configured to run this scheduled task must have "Log on as a batch job" rights on the computer that hosts the exe you are launching. This can be configured on the local security policy of the computer that hosts the exe. You can change the policy (on the server hosting the exe) under
Administrative Tools -> Local Security Policy -> Local Policies ->
User Rights Assignment -> Log On As Batch Job
Add your user to this list (you could also make the user account a local admin on the machine hosting the exe).
Finally, you could also simply copy your exe from the network location to your local computer and run it from there instead.
Note also that a domain policy could be restricting "Log on as a batch job" rights at your organization.
Had the same issue but mine was working for weeks before this. Realised I had changed my password on the server.
Remember to update your password if you've got the option selected 'Run whether user is logged on or not'
Just adding this for anyone with the same problem as me, I was getting the "Task Start Failed" error because I had changed my Windows password so I had to open the task properties and save with the new password.
Had the same issue today. I added the user to:
Administrative Tools -> Local Security Policy -> Local Policies -> User Rights Assignment -> Log on as a batch job
But was still getting the error. I found this post, and it turns out there's also this setting that I had to remove the user from (not sure how it got in there):
Administrative Tools -> Local Security Policy -> Local Policies -> User Rights Assignment -> Deny log on as a batch job
So just be aware that you may need to check both policies for the user.
I have the same today on Win7.x64, this solve it.
Right Click MyComputer > Manage > Local Users and Groups > Groups > Administrators double click > your name should be there, if not press add...
I have changed the method of execution of the task and now it performs it without problems
Related
My main problem is I am facing the problem ->
when i am trying to execute my exe file (which i written and compiled in C using GCC). I have found the solution and the solution is to change some of the settings under gpedit.msc
run -> gpedit.msc -> computer configuration -> windows settings -> security settings ->
local policies -> security options
there are multiple files. I just want to edit files whose name starts with "User Account Control: "
Either i want to enable or disable them. How can i do that programatically using cmd/batch script?
till now i have found secdit but that does not edit the values. link -> scroll down little bit and you will find secedit. I also used resource monitor to observe registry changes when i disable something according to this link -> Use Process Monitor to Find Registry Changes. But nothing shows up. Somewhere in the internet i also found that security policies are not always associated with registry values. But i forgot to save the link. I also found this stackoverflow article Modify Local Security Policy using Powershell
. But i can't understand anything as i know nothing about powershell programming and secedit or "how to edit database". Please provide some juicy resources to learn about editing security policies.
For your information i am building my program.exe in my local computer (house pc) and transferring the generated exe in "Amazon EC2 instance". If you say compile the program in "Amazon EC2" RDP i will say that i dont need to do that because my program.exe is running fine in "Amazon EC2" if i disable or enable some of the "User Account Control: " settings
Here is everything I wanted to know -> Registrykey Values Associated with local policies and thanks to -> Grzegorz Ochlik.
I've recently run into an issue where group policy is failing to apply on a few computers. When I run GPUPDATE /FORCE, this is the output:
Updating policy...
Computer Policy update has completed successfully.
The following warnings were encountered during computer policy processing:
Windows failed to apply the Group Policy Folders settings. Group Policy Folders settings might have its own log file. Please click on the "More information" link.
Windows failed to apply the Group Policy Files settings. Group Policy Files settings might have its own log file. Please click on the "More information" link.
Windows failed to apply the Group Policy Registry settings. Group Policy Registry settings might have its own log file. Please click on the "More information" link.
User Policy update has completed successfully.
The following warnings were encountered during user policy processing:
Windows failed to apply the Group Policy Folders settings. Group Policy Folders settings might have its own log file. Please click on the "More information" link.
Windows failed to apply the Group Policy Files settings. Group Policy Files settings might have its own log file. Please click on the "More information" link.
Windows failed to apply the Deployed Printer Connections settings. Deployed Printer Connections settings might have its own log file. Please click on the "More information" link.
Windows failed to apply the Group Policy Folder Options settings. Group Policy Folder Options settings might have its own log file. Please click on the "More information" link.
Windows failed to apply the Group Policy Scheduled Tasks settings. Group Policy Scheduled Tasks settings might have its own log file. Please click on the "More information" link.
For more detailed information, review the event log or run GPRESULT /H GPReport.html from the command line to access information about Group Policy results.
I've done the following to troubleshoot, but I keep hitting walls and dead ends:
Removed and readded the faulting computers to the domain
Confirmed domain connectivity by successfully pinging domain controllers
Confirmed DNS settings haven't been changed on NICs
Used ProcMon to see if new files/folders are being added, but saw no references to these files/folders
Investigated Event Viewer, but only see generic errors like, "Windows failed to apply the Group Policy Files settings. Group Policy Files settings might have its own log file. Please click on the "More information" link." Diving deeper into Event Viewer -> Applications and Services Logs -> Microsoft -> Group Policy -> Operational gives me errors with descriptions like, "Completed Group Policy Shortcuts Extension Processing in 62 milliseconds."
Checked RSOP on the faulting computers, and while I see the policy I'm trying to push listed in the General tab, the Error Information tab shows that Group Policy Registry, Folders, and Files all failed. The Details section simply states, "Group Policy [Registry/Files/Folders] failed due to the error listed below", yet no error is listed.
Ran GPRESULT /H GPReport.html and examined, but only receive generic messages like, "Additional information may have been logged. Review the Policy Events tab in the console or the application event log for events between 2/18/2021 12:29:39 PM and 2/18/2021 12:29:39 PM." This additional information referenced is reflected in point 5 above and is obviously unhelpful.
Tried GPUPDATE /SYNC, but I receive the error, "Failed to set the policy mode. Error - The system cannot find the file specified. Exiting...," and I have no idea what file this error is referencing.
Checked Event Viewer on domain controller, but found no relevant information about these failures
Checked for FS corruption via SFC /SCANNOW and DISM /ONLINE /CLEANUP-IMAGE /RESTOREHEALTH
I'm really pulling my hair out over this one. If anyone could point me in the right direction or provide a fix, that would be incredible. Thank you so much!
I am working on automating group policy settings using PowerShell in Windows Server 2012 R2.
I have lot of local group policy settings to achieve through PowerShell.
As an example I am showing this
Press Windows key > type Run and type gpedit.msc. Expand Computer
Configuration > Windows Settings > Security Settings >
Account Policy > Password Policy or Account Lockout Policy container
In this I need to enable the setting called Passwords Must Meet Complexity Requirements using PowerShell.
I achieved automating services start-up type using the cmdlets.
As an example
Set-Service -name vds -StartupType disabled
But I am struggling to start with local group policy settings.
I have also attached a screenshot regarding this.
If anyone have any idea on this Please help me.
I have a task scheduled in my Windows 2008 R2 machine but it failed to trigger with the following error in the log (Event logs).
Error:
Task Scheduler failed to start "\Hyatt_International_Distribution" task for user "SAFFRON3\cb_admin". Additional Data: Error Value: 2147943645.
Task Scheduler failed to start Task Engine "" process due to an error occurring in "LUAIsElevatedToken" . Command="taskeng.exe" . Additional Data: Error Value: 2147943645.
The complete error is as below:
Log Name: Microsoft-Windows-TaskScheduler/Operational
Source: Microsoft-Windows-TaskScheduler
Date: 4/16/2012 9:59:59 AM
Event ID: 101
Task Category: Task Start Failed
Level: Error
Keywords:
User: SYSTEM
Computer: xyz
Description:
Task Scheduler failed to start "\Distribution" task for user "SAFFRON3\cb_admin". Additional Data: Error Value: 2147943645.
Event Xml:
<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>0x8000000000000000</Keywords>
<TimeCreated SystemTime="2012-04-16T14:59:59.950Z" />
<EventRecordID>101476</EventRecordID>
<Correlation />
<Execution ProcessID="336" ThreadID="1216" />
<Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
<Computer>xyz</Computer>
<Security UserID="S-1-5-18" />
</System>
<EventData Name="TaskStartFailedEvent">
<Data Name="TaskName">\Distribution</Data>
<Data Name="UserContext">SAFFRON3\cb_admin</Data>
<Data Name="ResultCode">2147943645</Data>
</EventData>
</Event>
The task is set as: Run s if user is logged in or not, With Highest privileges, Power: Start when on AC power, Allow task run on demand.
The task runs almost everyday, correctly, but failed yesterday. Any particular reason?
On properties,
Check whether radio button is selected for
Run only when user is logged on
If you selected for the above option then that is the reason why it is failed.
so change the option to
Run whether user is logged on or not
OR
In other case, user might have changed his/her login credentials
My task was set to Run only when user is logged on and it was failing for me even while I was logged in and starting it manually. The user was set to me already. No password changes, etc.
I solved it by clicking "Change user" and selecting myself again.
I suspect it may have been caused by AD changing the user SID or something to that extent. Perhaps IT was doing some user management in AD, who knows.
I solved the issue by opening up the properties on the exe-file itself. On the tab Compatibility there's a check box for privilege level that says "Run this as an administrator"
Even though my account have administration privileges it didn't work when I started it from task scheduler.
I unchecked the box and started it from the scheduler again and it worked.
As far as I know you will need to give the domain account the proper "User Rights" such as "Log on as a Batch Job". You can check that in your Local Policies. Also, you might have a Domain GPO which is overwriting your local policies. I bet if you add this Domain Account into the local admin group of that machine, your problem will go away. A few articles for you to check:
http://social.technet.microsoft.com/Forums/en/windowsserver2008r2general/thread/9edcb63a-d133-45a0-9e8c-f1b774765531
http://social.technet.microsoft.com/Forums/lv/winservergen/thread/68019b24-78a5-4db0-a150-ada921930924
http://sqlsolace.blogspot.com/2009/08/task-scheduler-task-does-not-run-error.html?m=1
http://technet.microsoft.com/en-us/library/cc722152.aspx
Right Click on the Task in Task Scheduler
Click on the Actions tab
Click on Edit
Remove the quotes around the path in the "Starts In" textbox.
My task also failed to start.
I solved it by specifying not only the path to the executable, but also the path to the folder of the executable (Tab "Actions" | Edit | TextBox "Start in").
Thanks all,
I had the same issue. I have a task that runs via a generic user account not linked to a particular person. This user as somehow logged off the VM, when I was trying to fix it I was logged in as me and not that user.
Logging back in with that user fixed the issue!
I was having the same issue. I tried with the compatibility option, but in Windows 10 it doesn't show the compatibility option. The following steps solved the problem for me:
I made sure the account with which the task was running had the full access privileges on the file to be executed.
(Executed the task and was still not running)
I man taskschd.msc as administrator
I added the account to run the task (whether was it logged or not)
I executed the task and now IT WORKED!
So somehow setting up the task in taskschd.msc as a regular user wasn't working, even though my account is an admin one.
Hope this helps anyone having the same issue
Check whether you are scheduling a task to trigger an executable (.exe) or a batch (.bat) file. If you have scheduled any other file to open (for example a .txt or .docx file), the file not open.
How would I set the "overwrite as needed" setting on Event logs other than Application/Security/System? Specifically I'd like to apply this to the Powershell and Windows Powershell Logs, in addition to any other future logs that may be added. This needs to be applied to both server 2003 & 2008.
Wow. I looked around on this and can't find any references to set GPO settings for event logs other than for System, Application, Security. That just seems wrong. You will have to script it for your domain or workgroup or workstation with wevtutil.exe (cmd) or limit-eventlog (powershell). Both utilities have remote connection built in.
wevtutil sl <Log Name> /rt:false
limit-eventlog -Log Name -OverFlowAction OverwriteAsNeeded
I don't believe their is a GPO for this. But most group policies simply modify the registry.
You could create an adm template that modified the settings, or you could simply write a script to adjust the settings.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\PowerShell
If you are not sure how to manually configure the settings, simply adjust the settings in the event log GUI, and set all your other systems to be the same. You may need to restart the system for the changes to go into effect.
Right now you'd need to use SDM Software's GPO cmdlets. That's the only way from within PowerShell to modify the settings within a GPO. But there's no way that I know of to make a change to "any logs which might be added" - I don't think you can modify the system defaults (although I could be wrong - it's not something I've done much).
Computer Configuration-->Windows Settings-->Security Settings-->Event Log