Can run script manually, but not with task scheduler

%3CLINGO-SUB%20id%3D%22lingo-sub-1843774%22%20slang%3D%22en-US%22%3ECan%20run%20script%20manually%2C%20but%20not%20with%20task%20scheduler%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1843774%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI've%20read%20quite%20a%20few%20posts%20regarding%20this%20issue%20and%20I've%20tried%20a%20whole%20bunch%20of%20tips%2C%20but%20I%20can't%20get%20the%20task%20scheduler%20to%20run%20my%20script.%20Could%20anyone%20please%20help%20me%20out%20here%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThese%20are%20the%20setting%20I've%20got%20at%20the%20moment%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xparicon_0-1604311325353.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F230785i433C123E35DDEE90%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xparicon_0-1604311325353.png%22%20alt%3D%22xparicon_0-1604311325353.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xparicon_1-1604311356099.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F230786iA661CFF07984E59D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xparicon_1-1604311356099.png%22%20alt%3D%22xparicon_1-1604311356099.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xparicon_2-1604311493047.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F230787i3F7BFE5DC3DB79D7%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xparicon_2-1604311493047.png%22%20alt%3D%22xparicon_2-1604311493047.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E(Arguments%3A%26nbsp%3B%3CSTRONG%3E-ExecutionPolicy%20Bypass%20-File%20C%3A%5CUsers%5Cinsept%5CDesktop%5CTheRealMatrix.ps1%3C%2FSTRONG%3E%20)%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xparicon_4-1604311569316.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F230789i717B1DE8360082C4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xparicon_4-1604311569316.png%22%20alt%3D%22xparicon_4-1604311569316.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22xparicon_5-1604311591602.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F230790iF75C444A19FEA530%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22xparicon_5-1604311591602.png%22%20alt%3D%22xparicon_5-1604311591602.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1843774%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1844439%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20run%20script%20manually%2C%20but%20not%20with%20task%20scheduler%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1844439%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F854211%22%20target%3D%22_blank%22%3E%40xparicon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOn%20task%20scheduler%2C%20what's%20the%20last%20run%20result%20code%20showing%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

I've read quite a few posts regarding this issue and I've tried a whole bunch of tips, but I can't get the task scheduler to run my script. Could anyone please help me out here?

These are the setting I've got at the moment:

xparicon_0-1604311325353.pngxparicon_1-1604311356099.pngxparicon_2-1604311493047.png

(Arguments: -ExecutionPolicy Bypass -File C:\Users\insept\Desktop\TheRealMatrix.ps1 )

xparicon_4-1604311569316.png

 

xparicon_5-1604311591602.png

 

 

 

 

2 Replies

Hi @xparicon 

 

On task scheduler, what's the last run result code showing?

 

 

@HidMov 

Heya! I was testing this out locally on my own computer.

But when I moved the script to the server were I wanted to run it the task seems to run just fine.

 

I can see that I got the result code 4294770688 in the history log on my own computer. Haven't been digging deeper in to what exactly caused it not to run properly since it worked on the server.