Is there a way to temporarily pause the Windows Task Scheduler so it doesn't launch new scheduled tasks in the middle of a critical operation?
I have a PowerShell script that syncs an HA server to an offsite hot backup site. Currently my PowerShell script creates a temporary VSS snapshot and syncs from that, which works nicely with apps that are VSS-aware. However, we have an old LOB app that likes to shoot off scheduled tasks and isn't easy to manage. If I pause or delete the LOB tasks they re-appear, etc. The LOB app itself is mission critical and cannot be paused.
Basically, I don't want any new scheduled tasks kicked off during the middle of the VSS snapshot creation operation. The Task Scheduler's own VSS writer merely reports its internal backup folder locations; it does not quiesce running tasks on its own as far as I can tell.
I tried to stop/restart the Scheduler service, but Windows 8 doesn't allow that unless you are LOCAL SYSTEM, and Windows Server 2016 Tech Preview 3 doesn't even allow LOCAL SYSTEM to stop it. Stopping the Task Scheduler isn't generally a good idea anyway, since it kills all running tasks. I learned this the hard way on Windows Server 2016 DC (TechPreview 3) when Microsoft added a new undocumented task called "CreateExplorerShellUnelevatedTask", which kills every user's desktop whenever the Task Scheduler service is stopped (ouch).