Sitecore PowerShell Extensions
  • Introduction
  • Disclaimer
  • Installation
    • Contributor Guide
  • Training
  • Community
  • Interfaces
    • Console
    • Scripting
    • Interface Configuration
    • Interactive Dialogs
    • Help
  • Working with Items
    • Item Languages
    • Item Renderings
    • Variables
    • Providers
  • Modules
    • Libraries and Scripts
    • Integration Points
      • Content Editor
      • Control Panel
      • Data Sources
      • Event Handlers
      • Functions
      • ISE Plugins
      • Page Editor
      • Pipelines
      • Reports
        • Authoring Reports
      • Tasks
        • Authoring Tasks
      • Toolbox
      • Web API
      • Workflows
    • Packaging
  • Remoting
  • Security
    • Users and Roles
  • Releases
  • Troubleshooting
  • Code Snippets
    • Item Links
    • Field Types
    • Manage Templates
  • Appendix
    • Common
      • Add-BaseTemplate
      • Add-ItemVersion
      • Close-Window
      • ConvertFrom-CliXml
      • ConvertFrom-ItemClone
      • ConvertTo-CliXml
      • Expand-Token
      • Get-Archive
      • Get-ArchiveItem
      • Get-Cache
      • Get-Database
      • Get-ItemClone
      • Get-ItemCloneNotification
      • Get-ItemField
      • Get-ItemReference
      • Get-ItemReferrer
      • Get-ItemTemplate
      • Get-ItemWorkflowEvent
      • Get-SitecoreJob
      • Get-SpeModule
      • Get-SpeModuleFeatureRoot
      • Get-TaskSchedule
      • Get-UserAgent
      • Import-Function
      • Invoke-JavaScript
      • Invoke-Script
      • Invoke-ShellCommand
      • Invoke-Workflow
      • New-ItemClone
      • New-ItemWorkflowEvent
      • New-UsingBlock
      • Out-Download
      • Publish-Item
      • Read-Variable
      • Receive-File
      • Receive-ItemCloneNotification
      • Remove-BaseTemplate
      • Remove-ArchiveItem
      • Remove-ItemVersion
      • Reset-ItemField
      • Restart-Application
      • Restore-ArchiveItem
      • Send-File
      • Send-SheerMessage
      • Set-HostProperty
      • Set-ItemTemplate
      • Show-Alert
      • Show-Application
      • Show-Confirm
      • Show-FieldEditor
      • Show-Input
      • Show-ListView
      • Show-ModalDialog
      • Show-Result
      • Show-YesNoCancel
      • Start-TaskSchedule
      • Test-BaseTemplate
      • Test-Rule
      • Update-ItemReferrer
      • Update-ListView
      • Write-Log
    • Indexing
      • Find-Item
      • Get-SearchIndex
      • Initialize-Item
      • Initialize-SearchIndex
      • Initialize-SearchIndexItem
      • Remove-SearchIndexItem
      • Resume-SearchIndex
      • Stop-SearchIndex
      • Suspend-SearchIndex
    • Packaging
      • Export-Item
      • Export-Package
      • Export-UpdatePackage
      • Get-Package
      • Get-Preset
      • Get-UpdatePackageDiff
      • Import-Item
      • Install-Package
      • Install-UpdatePackage
      • New-ExplicitFileSource
      • New-ExplicitItemSource
      • New-FileSource
      • New-ItemSource
      • New-SecuritySource
      • Import-Item
      • New-Package
    • Presentation
      • Add-PlaceholderSetting
      • Add-Rendering
      • Get-Layout
      • Get-LayoutDevice
      • Get-PlaceholderSetting
      • Get-Rendering
      • Get-RenderingParameter
      • Merge-Layout
      • New-PlaceholderSetting
      • New-Rendering
      • Remove-PlaceholderSetting
      • Remove-Rendering
      • Remove-RenderingParameter
      • Reset-Layout
      • Set-Layout
      • Set-Rendering
      • Set-RenderingParameter
      • Switch-Rendering
    • Provider
      • Get-Item
    • Security
      • Add-ItemAcl
      • Add-RoleMember
      • Clear-ItemAcl
      • Disable-User
      • Enable-User
      • Export-Role
      • Export-User
      • Get-Domain
      • Get-ItemAcl
      • Get-Role
      • Get-RoleMember
      • Get-User
      • Import-Role
      • Import-User
      • Lock-Item
      • Login-User
      • Logout-User
      • New-Domain
      • New-ItemAcl
      • New-Role
      • New-User
      • Protect-Item
      • Remove-Domain
      • Remove-Role
      • Remove-RoleMember
      • Remove-User
      • Set-ItemAcl
      • Set-User
      • Set-UserPassword
      • Test-Account
      • Test-ItemAcl
      • Unlock-Item
      • Unprotect-Item
      • Unlock-User
    • Session
      • Get-ScriptSession
      • Get-Session
      • Receive-ScriptSession
      • Remove-ScriptSession
      • Remove-Session
      • Start-ScriptSession
      • Stop-ScriptSession
      • Wait-ScriptSession
Powered by GitBook
On this page
  • Video Tutorial
  • Scheduled Task Command
  • Create and Manage Tasks
Export as PDF
  1. Modules
  2. Integration Points

Tasks

PreviousAuthoring ReportsNextAuthoring Tasks

Last updated 5 years ago

The task scheduler is a great way to run scripts in a periodic fashion. You may find the need to automatically archive log files into a compressed file. Perhaps send an email with a generated report based on stale site content.

Video Tutorial

Scheduled Task Editor

Scheduled Task Command

To help make the setup simple, we've provided a Task Command.

The command shown above is simply a type exposed as a public method in the Spe assembly. There exists an update method which accepts one or more items and executes the associated script.

Beneath Schedules you can create as many tasks as Sitecore will allow. Configure the Command and Items fields like that shown below.

The Items field contains the path to a script in the Script Library.

Below are some of the scripts found out-of-the-box with SPE.

Module

Script

System Maintenance

Archive Sitecore logs, Clean up deleted items older than 30 days

User Session Management

Remove idle user sessions

Create and Manage Tasks

We've added a context menu item to provide you with a shortcut to the Task Scheduler Editor.

Create a new scheduled task:

Run or edit the scheduled task:

The scheduled task is capable of running 1-to-many scripts. Choose all that apply for the selected task. Each script runs within a shared session, making it possible to share results between scripts.

Note: Make use of the Enable Rule to take advantage of the rules engine.

The task schedule has an intuitive dialog for working with and changing the frequency.

Note: Examples included are in the following modules

  • License Expiration

  • Media Library Maintenance

  • System Maintenance

See how Adam added .

Click for a demo
powershell driven Sitecore scheduled tasks
PowerShell Script Command
PowerShell Script Task
Insert Option for Task
Run or Edit Task Schedule
Dialog to Select Task Scripts
Dialog to Edit Task Schedule