Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Edit Duration and repetition interval for an existing job in a Powershell oneliner

$
0
0
Hi All

I have enabled a job that repeats daily once. Like:

Register-ScheduledJob -Name SomeJob -Credential host00\idiot00 -ScriptBlock {Some-Job} -Trigger (New-JobTrigger -Daily -At "21:00")

I want to edit the job, obviously, as no job might complete if it runs with permissions of "idiot00". Additionally, in case the computer is down, the system should try to run the job again as soon as the computer is up again. With success I only get as far as this:

Get-ScheduledJob SomeJob | Set-ScheduledJob -Credential host00\SYSTEM -Trigger (New-JobTrigger -Daily -At "19:00")

Yes, I can even change the time ("19:00").

I'm getting errors as soon as I try to insert some RepetitionInterval or RepetitionDuration. So I might need something like:

–RepetitionInterval 0:15 –RepetitionDuration 3:00

That is: I want the system try repeat the job for 3 hours every 15 minutes.

I've tried lots, googled even more, to no avail.

Please: Don't give me scripts - I'm not interested at all. Just tell me, if possible, whether I can complete the task in a oneliner in Powershell, and if yes, you maybe even know how to do that.

Thanks in anticipation.

And this:
Anyone out there who can tell me how to switch of this cursor in the message editing field of this forum, that deletes everything following of what I type, instead of simply marking the place where I want to add text? Never seen something like that ...

Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>