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

 
Keymaster
3 years, 8 months ago.

  • Author
    Posts
  • #22181

    Participant
    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

    Thanks,
    Aravinda

  • #22222

    Keymaster
    Points: 1,524
    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.