Task Scheduler Resource

Welcome Forums DSC (Desired State Configuration) Task Scheduler Resource

This topic contains 1 reply, has 2 voices, and was last updated by

4 years, 4 months ago.

  • Author
  • #22181

    Topics: 18
    Replies: 16
    Points: 0
    Rank: Member

    Hi All,

    Is there any resource available in DSC kit using which I can schedule a task in Windows Server 2012 ?
    If there is no resource how can I achieve the below powershell code in DSC?

    schtasks /create /tn "IISLogRetention" /tr "powershell.exe $executionpath" /sc daily /st 03:00:00 /ru System


  • #22222

    Topics: 13
    Replies: 4872
    Points: 1,812
    Helping HandTeam Member
    Rank: Community Hero

    You can see the complete DSC Resource Kit at https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d. As you can see, there doesn't appear to currently be a resource for managing scheduled tasks. That means you'd have to write your own resource.

    The "Hey Scripting Guy" blog on Microsoft recently ran an entire series on managing scheduled tasks in PowerShell. You could probably use that as a starting point for authoring a resource. Mind you, the blog wasn't about authoring resources – you'll need to know how to do that.

The topic ‘Task Scheduler Resource’ is closed to new replies.