8

When using Server 2012 I disabled the (evil) Automatic Maintenance task using the following commands (originally found here):

psexec \\SERVERNAME -s schtasks /change /tn "\Microsoft\Windows\TaskScheduler\Maintenance Configurator" /DISABLE
psexec -s schtasks /change /tn "\Microsoft\Windows\TaskScheduler\Maintenance Configurator" /DISABLE

When I try to run this on Server 2016 those entries do not exist. I know it is somewhere because TiWorker.exe eats up a bunch of CPU doing whatever it does. Does anyone know where this setting is in Server 2016?

4 Answers 4

2

Looks like that task isn't included in Server 2016. I verified this on a fresh install. Windows appears to run the maintenance scheduled tasks individually now.

The one that runs tiworker and the one that I'm finding the most intrusive is the SilentCleanup task, which runs disk cleanup whether the disk space is low or not, counter to its description. That one can be found under the DiskCleanup folder. I think I'm going to disable this task across the board since there is no reason a server should be running automatic disk cleanup IMO.

Edit: I found a way to check what all the maintenance tasks are:

$MaintTasks = @()
foreach ($task in (Get-ScheduledTask))
{
if (($task | Export-ScheduledTask) -like “*maintenance*”) {$MaintTasks += $task}
}
$MaintTasks
1

On a fresh WS 2016 install:

Get-ScheduledTask | Where-Object -Property Description -Match "maint"

TaskPath                                       TaskName                          State     
--------                                       --------                          -----     
\Microsoft\Windows\ApplicationData\            DsSvcCleanup                      Ready     
\Microsoft\Windows\Diagnosis\                  Scheduled                         Ready     
\Microsoft\Windows\DiskCleanup\                SilentCleanup                     Ready     
\Microsoft\Windows\Windows Defender\           Windows Defender Cache Mainten... Ready

The Diagnosis task seems to be relevant. It's using a custom handler. Have you dug into that yet?

2
  • According to Windows scheduler the Diagnosis\Scheduled task has never run. I will check a few others.
    – Shaun Bowe
    Feb 3, 2017 at 18:40
  • Shaun, did this work? Jun 19, 2017 at 23:50
0

This will disable the Disk optimization job (Tested on a Windows Server 2016):

If ((Get-ScheduledTask -TaskName 'ScheduledDefrag').State -eq 'Ready') 
{
    Disable-ScheduledTask -TaskName 'ScheduledDefrag' -TaskPath '\Microsoft\Windows\Defrag'
}
-1

Use PSEXEC. After downloading PSEXEC, open a Command Prompt with elevated permissions, and type:

psexec \%computername% -s schtasks /change /tn "MicrosoftWindowsTaskSchedulerMaintenance Configurator" /disable
4
  • There are no backslashes anymore? Is that what you're trying to say? Jan 21, 2017 at 20:42
  • I will try this out tomorrow. I have PSEXEC already but the path I noted does not exist on server 2016.
    – Shaun Bowe
    Jan 22, 2017 at 18:21
  • 2
    This doesn't work. The scheduled task name appears to have changed but I cannot find it.
    – Shaun Bowe
    Jan 27, 2017 at 17:01
  • This looks exactly like the command the OP already tried, but without obviously necessary backslashes. Am I missing something? Jan 31, 2017 at 21:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .