New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New command] Test-DbaScheduledTask, #828
Comments
I'm intrigued :) How would we test that the scheduled tasks state is best practice? |
Hi, it's simply comparing: I've already created the script and doing some testing now. |
I'm digging it. Any others on that list? Remember, though, that we write for PS 3 which does not include Get-ScheduledTask. You'll have to use |
jsut started with the defrag because i had performance problems quite recently. Thanks. for the advice. I'll change it in my script. |
The only issue with this is that task is not a standard for Windows OS. Basically, you will never find a scheduled task on a given server called "ScheduledDefrag" or anything else because it is not there by default. The only way that task exist is if you happen across an environment that someone created it with the exact same name. So looking for that name specifically is not going to work. You might be able to look at task that are calling defrag utility, but not sure that will be 100% accurate either...there are many 3rd party apps that monitor and handle defrag as well. |
In fact this jobs is enabled by default since 2012. That was cause a lot of trouble for me. |
there's more to it than it seems. |
And suggesting disabling for everyone as a defacto standard isn't a smart choice... defragging still needs to be done to avoid slowly crawling performances. |
tl;dr: run defrag.exe -c -h -k -g -$ and see it exiting instantaneously almost everywhere. |
This is strictly my opinion, but I have been in multiple high-end environments that were doing millions of transactions a second for online sites. I have never had to disable this scheduled task, and likely would never do so. That task itself is hidden, you cannot visibly access it using Task Scheduler and the only way to even disable it that I can find is from command line. In the years I have been support SQL Server since 2012 OS came out I have never come across this scheduled task being an issue. I also do not believe it is best practice to disable that task, MS put it there for a reason. If you believe it is best practice then you need to come up with an authoritative reference stating as such. In that sense I would not make any mention of this being best practice unless it can be shown that it is a recommended practice from either MS or the community. |
going to close this in a few days if @MARCO-K got what we are telling (which is, basically, that task isn't definitely a bad practice) |
agreed, thanks you guys for the feedback and taking the time to explain! |
Is this a feature OR bug:
This is a new feature.
Details
Basically the cmdlet verifies if ScheduledTask state is configured accorind the Windows-based best practice.
The intention of this new command is to verify the state of the scheduled taks "ScheduledDefrag". I had huge performance hits causing SQL iserver to slow down a lot with the task enabled.
The text was updated successfully, but these errors were encountered: