- This topic has 3 replies, 3 voices, and was last updated 6 days, 15 hours ago by
July 1, 2020 at 4:48 am #239447ParticipantTopics: 39Replies: 46Points: 88Rank: Member
Hi, I have created PS scheduled job (v 5.1) that executes script producing HTML report of expiring certificates. I would like to run this script on every 1st and 15th of the month at 5:00 am AZ time. Is this doable? When I try to accomplish this directly from task scheduler GUI job does not run on given schedule with Get-ScheduledJob complaining about unknown trigger type:
Get-ScheduledJob : An unknown trigger type was returned from Task Scheduler for scheduled job definition Expiring Certificates Report with trigger ID
What can be done here?
Thx in advance.
- This topic was modified 6 days, 22 hours ago by Bojan Zivkovic.
July 1, 2020 at 5:36 am #239459ParticipantTopics: 5Replies: 2372Points: 6,005Rank: Community MVP
When I try to accomplish this directly from task scheduler GUI job does not run on given schedule …
So there might be another issue with your task. I usually use the cmldets for scheduled tasks (not jobs):
Get-Command -Noun *scheduledtask*
July 1, 2020 at 6:53 am #239495ParticipantTopics: 39Replies: 46Points: 88Rank: Member
With other PS scheduled jobs I do not have problems – Get-ScheduledJob returns all PS scheduled jobs. Here problem probably lies in the fact PS scheduled jobs do not support monthly schedules (in GUI I put trigger as monthly on 1st and 15th day) – exactly what I need.
July 1, 2020 at 12:28 pm #239546ParticipantTopics: 3Replies: 417Points: 1,462Rank: Community Hero
ScheduledJobs are not a replacement for scheduled tasks. As you’ve discovered, there is no monthly [Microsoft.Powershell.ScheduledJob.TriggerFrequency]. If you want that granular control, and scheduledjob doesn’t do it, then you should use scheduledtask. You can have the scheduled task run a script with the same exact job, you can even output it to XML to the default location if you prefer. You should not try to edit the job in the GUI. Some good info you may have seen already, but in case you haven’t and for others.
- You must be logged in to reply to this topic.