Posts

Showing posts from July, 2021

Execute PowerShell Script with Sitecore Scheduler

Image
If you have a requirement like execute PowerShell script in form of a scheduler then Sitecore Scheduler provides an option for the same. For Example, you want to delete some Sitecore Items after a specific date or remove the ideal user at some specific time. For that, you have written a PowerShell script instead of C# code and you want to schedule the PowerShell Script with a Scheduler. Then Sitecore Scheduler provides you a good option to execute PowerShell Script. If you want to know How to Install the PowerShell module with your Sitecore instance and the ideas about the PowerShell command and Scripts then, please refer series of blog posts written on: PowerShell with Sitecore . Here I am giving you an example to create a Sitecore Item using PowerShell Script and Schedule that Script by Sitecore Scheduler. You can update your PowerShell script as per your requirement. Step 1: Go to the PowerShell ISE, you can open it by Sitecore Launchpad or

Jobs in Sitecore

Image
Sitecore Jobs are used to calling the task or method which takes more time to execute. It allows us to start and execute the task in the background without affecting the other task and thread's executions. We can monitor the jobs via Admin section in {Sitecore- Instance}/sitecore/admin/jobs.aspx page . So, in one line you can say Sitecore Jobs are perfect options to run the long execution methods. Now the question is why Sitecore Job? Sitecore calls the <job> Pipeline to execute each job. Sitecore calls a separate thread for each job execution so that your code will be executed in the background without affecting any other method, thread block, etc. Sitecore also provided an admin section page to monitor the jobs. You can set the status and priority of the jobs. You can run multiple jobs at the same time without any interference. Sitecore Job provides job-related events like job:starting, job:started, job:ended , so tha