Setting Timer Jobs at on-premises SharePoint 2010, 2013, 2016, or 2019 using PowerShell

Note: The Timer Jobs only work with on-premises SharePoint and not SharePoint Online, as is a cloud-based version, the architecture and management of timer jobs are handled by Microsoft, and the end user do not have direct access to create or install custom timer jobs.

As a SharePoint Admin, there are a lot of cleaning, indexing, trigger workflow, and maintenance tasks that have to be performed periodically, in such a case you can make use of a timer job that can help run background processes on one or more SharePoint servers farms at a scheduled task periodically.

You can setup a timer job in SharePoint using PowerShell, by following the below steps: