Last night I was working in my lab and all of a sudden I’ve noticed that one of my VMs was extremely slow to answer without any specific reason, checking the NAS I/O quickly revealed that was not the problem so concentrating on the guest OS I quickly found out the CPU usage was out of control being used by a process named TiWorker.exe I suddenly realized I forgot to disable something really important.
Windows 2012 R2 automatically installs and configures a scheduled task that will perform some cleanup on your server at scheduled intervals if you’re interested you can read more here the automatic maintenance task is visible through the Action Center
As you can see the automatic maintenance is even running on my system as I write this post and that means my server at the moment will take forever to do anything as the main goal of this task seems to be killing your server once a day as you can see:
Logic would tell that going to scheduled tasks and disabling the automatic maintenance would be enough to get rid of the problem, unfortunately it is not that easy as this cannot be done from the GUI, if you don’t believe me try it and check the server again after a couple of hours, and you have to resort to psexec from (ex)Sysinternals which can be downloaded from here.
The command you’ll need to launch from an elevated command prompt is:
# Disable Windows 2012 Automatic maintenance task psexec \SERVERNAME -s schtasks /change /tn "MicrosoftWindowsTaskSchedulerMaintenance Configurator" /DISABLE
Once the command executed successfully
As usual test everything before implementing any change in a productive OS but I can tell out of experience I’ve enabled this for couple of servers, both in my lab and for customers, without any advert consequence.