register-schedulejob not running

Welcome Forums General PowerShell Q&A register-schedulejob not running

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

10 months ago.

  • Author
  • #99259

    Points: 1
    Rank: Member

    Hello there everyone,
    I tried running the following script as a scheduled job, but for some reason it does not run as a scheduled job. The script works, but I believe that I may be doing something incorrectly with the register-schedulejob comdlet. Anyone might providing input? Thank you very much. this has been a hit or miss for me and I am near certain that I am doing something incorrectly. Thank you again for taking your time to help!

    receive-job * -keep returns nothing.

    Import-Module activedirectory
    $Trigger = @()
    $Trigger += New-JobTrigger -Daily -at "1:00 PM"
    $Trigger += New-JobTrigger -Daily -at "5:00 PM"
    $Option = New-ScheduledJobOption -RequireNetwork -WakeToRun
    $Credentials = Get-Credential
     Register-ScheduledJob -Name "Provision-Computers" -ScriptBlock { 
    } -Trigger $Trigger -ScheduledJobOption $Option -MaxResultCount '2' -Credential $Credentials -RunNow
  • #99636

    Points: 4
    Rank: Member

    Do you see the job if you run Get-ScheduledJob?

    I haven't worked with Scheduled Jobs much, but Scripting Guy wrote an introduction to Scheduled Jobs that might be helpful:

The topic ‘register-schedulejob not running’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort