Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

correct

$
0
0

Hello everyone, I'm a pretty good PowerShell scripter but I'm stuck on an issue that I cannot quite resolve.  Here is my problem:

I have a PowerShell job that I want to resume after a computer reboot (This is a PowerShell workflow that I've suspended processing on so now I want to resume the job).  To get the Powershell job to resume, I want to use a scheduled task and I've created the schedule task with PowerShell.  I'm following the example in this blog article: http://blogs.msdn.com/b/powershell/archive/2013/12/23/automatically-resuming-windows-powershell-workflow-jobs-at-logon.aspx

Current behavior: after the computer reboot, the scheduled task won't execute.  The schedule task executes successfully when I run it manually via GUI.

Desired behavior: have the powershell job resume after computer reboot using schedule task (I'm OK if there is some other method of getting the powershell job to resume...I think powershell schedule job module can do powershell job management but I couldn't find much information on it)

I'm seeking if someone could provide a powershell script for provisioning a scheduled task [I'm not sure if the issue is the powershell script itself or schedule task module not behaving properly]  --or-- if someone has powershell syntax that would resume a powershell job after computer reboot/on system startup (when nobody has login).  That would be awesome..being able to suspend/resume a powershell workflow automatically after reboot would be great.

---some other details

- I'm running W2012R2 (Azure virtual machine).  Machine not joined on the domain.

-schedule task options: General > Security > Run whether user is logon or not; runs under Administrator; Triggers > On Startup

Thanks in advance for your assistance!

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles