register-ScheduledJob as local system

This topic contains 3 replies, has 2 voices, and was last updated by  eugene r 2 years ago.

  • Author
  • #41643

    eugene r

    I need to schedule tasks on Windows 2008 R2 that would run as system/local service so they could be run when no users are logged in without saving a password. Can I do it using register-ScheduledJob?

    Here is a sample job

    $trigger = New-JobTrigger -Once -At 7am -RepetitionDuration ([TimeSpan]::MaxValue) -RepetitionInterval  (New-TimeSpan -Minutes 60)
    Register-ScheduledJob -Name Test-Trigger $trigger -ScriptBlock {get-service}
  • #41661

    Wes Stahler

    I have done this in the past with Register-ScheduledTask.

  • #41664

    eugene r

    Thanks Wes, but Register-ScheduledTask only available starting Windows 2012.

  • #41666

    eugene r

    This link explains how to schedule tasks on earlier version of windows:

    But I say that I am bit surprise that Register-ScheduledTask is not available on Windows 2008 with powershell 4/5.


You must be logged in to reply to this topic.