If you're a applications packager, I'm sure you would of had a belt of the raging applications packager in relation to the TiWorker thread. You snap back to a clean state, start packaging your gubbins, chat to someone for 5mins turn back to carry on - you find your virtual machine slow...what a crappy application you think...carry on...get annoyed...Task Manager...look confused and wonder why TiWorker is flogging the CPU...maybe the app called it?...leave it for awhile...get fed up with it and kill the process in hopes it won't wreck your sequence...
After much annoyance and seeing this on a few different machines and operating systems while sequencing, I decided to look into it. Found out it was part of the maintenance program from Microsoft (thanks guys!). At the same time I found a fix, well kinda of a fix, side effect unknown at this point.
TiWorker flogging the CPU to 99%
*Friendly Task Manager name: Windows Modules Installer Worker
No point reinventing the wheel, this page describes the problem in detail.
Affected operating systems:
- Windows 8/8.1
- Windows Server 2012/2012 R2
Disable as mentioned in "Automatic Maintenance in Windows Server 2012R2 is EVIL". My requirement was slightly different as I deploy my packaging machines via a script, so thus I needed a scripted solution. I tried the psexec, but I ran into problems - my deployment solution is kinda weird, but very cool, it make snaps shots and etc. I tried Invoke-TokenManipulation.ps1, worked when logged and in GUI mode, but with not my solution, I think security token used was missing bits (speculation here, I just know it didn't work). Btw check out Invoke-TokenManipulation.ps1, it's very cool.
In the end I found and combine two solutions, then scripted it. Results below.
#Powershell #Relax security rights on the Task, then disable the task.
takeown /A /F "$env:WinDir\System32\Tasks\Microsoft\Windows\TaskScheduler\Maintenance Configurator"
icacls "$env:WinDir\System32\Tasks\Microsoft\Windows\TaskScheduler\Maintenance Configurator" /Grant Administrators:F
schtasks /Change /tn "\Microsoft\Windows\TaskScheduler\Maintenance Configurator" /Disable
As mentioned before, not sure of the side effects, I will come back and update this blog if I discover any. Buy the looks of it, just house keeping stuff, like tidying up the component store and compressing stuff - it's probably doing more though. Lastly, I don't recommend this on production machines for obvious reasons.
Credits and Reference: