spjeff / spbestwarmup

Tired of waiting for SharePoint pages to load? Want something easy to support? That works on all versions? This warmup script is for you!
2 stars 0 forks source link

Additional triggers for scheduled task #7

Closed chheim closed 7 years ago

chheim commented 8 years ago

Hi Jeff, first of all I'd like to say thanks for the great work, this is by far the best warmup script I have seen since I am dealing with SharePoint (9 years). Two thumbs up!

I'd like to suggest a further improvement you might want to think about. You could create the scheduled task with further triggers. How about not just starting the script by schedule? You could create a scheduled task that has multiple triggers:

You could achieve this by listening for eventlog IDs (see attachment). This would make your script reacting properly on what is happening on your system.

Keep on doing this great work, Viele Grüße aus Deutschland,

Christian

warmup-triggers

spjeff commented 8 years ago

Hey Christian!

Thank you for the kind words! Glad you found it helpful. =)

Today Line 147 creates the Task Scheduler job with "SCHTASK /C" command line. https://github.com/spjeff/spbestwarmup/blob/master/SPBestWarmUp.ps1#L146

Do you know how to add these Triggers with PowerShell? Or command line?

It's a good point and I'd be glad to merge in more features with some sample code. The frequent interval sort of catches these scenarios (and more) but will some lag time. Wait 10-15 minutes and it's always warmed up, but I also see benefit for more triggers to reduce that lag time.

Thanks for helping make this open source project better.

Cheers!

chheim commented 8 years ago

Hi Jeff, thanks for getting back on this proposal so quick!

You could use the Add-JobTrigger PowerShell Command to create additional triggers. See the TechNet article (https://technet.microsoft.com/de-de/library/hh849773.aspx) for further Infos. They explain how to add the trigger for the scheduled task to run on system startup.

I am unsure how to add the event triggers that listen to the system eventlog. It might be helpful to look at the attached export XML of a scheduled task, that I manually configured to listen to the system eventlog of my lab machine. Those triggers worked on my machine after I created them manually.

Scheduled Task Export.zip

Have a great Weekend, Christian

chheim commented 8 years ago

Von: Jeff Jones [mailto:notifications@github.com] Gesendet: Donnerstag, 1. September 2016 20:44 An: spjeff/spbestwarmup spbestwarmup@noreply.github.com Cc: Christian Heim Christian.Heim@microsoft.com; Author author@noreply.github.com Betreff: Re: [spjeff/spbestwarmup] Additional triggers for scheduled task (#7)

Hey Christian!

Thank you for the kind words! Glad you found it helpful. =)

Today Line 147 creates the Task Scheduler job with "SCHTASK /C" command line. https://github.com/spjeff/spbestwarmup/blob/master/SPBestWarmUp.ps1#L146

Do you know how to add these Triggers with PowerShell? Or command line?

It's a good point and I'd be glad to merge in more features with some sample code. The frequent interval sort of catches these scenarios (and more) but will some lag time. Wait 10-15 minutes and it's always warmed up, but I also see benefit for more triggers to reduce that lag time.

Thanks for helping make this open source project better.

Cheers!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/spjeff/spbestwarmup/issues/7#issuecomment-244173301, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AUq7EaJWMx1gFY9_lhv1qdBgnN2xsZnRks5qlxzjgaJpZM4JyseN.

spjeff commented 7 years ago

Hey Christian,

Lars submitted a PR with code changes to support more triggers. Please download the latest and give it a try. Should resolve this issue.

https://github.com/spjeff/spbestwarmup/pull/9