error when running tasks - VisualCron - Forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Coconut01
7 years ago
Hi,

I've just had Visual Cron upgraded to 8.2.9 (wooo) and when i've created my first job i get the following error when i try to run it. I'm using a domain account that works fine with older versions of Visual Cron and the VC service is running. I've tried restarting the service and the server with no difference. I've run the default job "Backup Settings" which doesn't use credentials and this worked fine so i suspect it's credential related. I've tried unticking the local login box and using a different domain user but still no joy. Any suggestions?

Thanks
VC error.PNG
Sponsor
Forum information
Support
7 years ago
Please enable extended debugging and then open the Credential you use and take a screenshot.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Coconut01
7 years ago
VC error 2.PNG

Thanks for the quick reply
Support
7 years ago
Can you send a screenshot of the Task settings as well (the specific Task properties).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Coconut01
7 years ago
VC error 3.PNG VC error 4.PNG

These are the only 2 tabs in the task window I've changed
Support
7 years ago
Can you try to create a simple PS script which outputs the current user and try to run it to see if there is a general issue;

[System.Security.Principal.WindowsIdentity]::GetCurrent().Name
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Coconut01
7 years ago
I created a new job with a powershell task running the powershell command you suggested. It works fine with no credential, if i add a credential it fails.
Support
7 years ago
Originally Posted by: Coconut01 

I created a new job with a powershell task running the powershell command you suggested. It works fine with no credential, if i add a credential it fails.



So, maybe something with that user.

1. try changing the Credential to CreateProcessAsUserW

or

2. try creating a local admin user and try that
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Coconut01
7 years ago
Morning,

I changed the credentials to CreateProcessAsUserW and the test powershell script works fine now thank you.

When i try to run a powershell file however it fails, although i can call the same powershell script via a cmd file and run the same script if i paste it into the powershell script text box. Does Visual Cron need extra permissions?
Support
7 years ago
VisualCron should run as the SYSTEM account and then you should raise permissions with Credentials when needed.

You can try turning off UAC from VisualCron and reboot. And then switch back to CreateProcessWithLogonW.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Coconut01
7 years ago
I'm not sure what you mean
I don't want to turn UAC off.
The pwershell script works if i paste it into VC and it works if VC calls a batch file that in turn calls the ps1 file, it doesn't work if VC runs the ps1 file.
Support
7 years ago
Originally Posted by: Coconut01 

I'm not sure what you mean
I don't want to turn UAC off.
The pwershell script works if i paste it into VC and it works if VC calls a batch file that in turn calls the ps1 file, it doesn't work if VC runs the ps1 file.



But is the Powershell script on the same drive as VisualCron?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Coconut01
7 years ago
yes, VC is installed on the same drive as the powershell script and the batch file
Support
7 years ago
Originally Posted by: Coconut01 

I'm not sure what you mean
I don't want to turn UAC off.
The pwershell script works if i paste it into VC and it works if VC calls a batch file that in turn calls the ps1 file, it doesn't work if VC runs the ps1 file.



What exact errors do you get when VC uses the PS1 file with writing current user name?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Coconut01
7 years ago
I've found this in the task log

ExecuteProcess("E:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 109)->System.IO.FileNotFoundException: Could not find file 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'.
File name: 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
ExecuteProcess("E:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 109)->Unhandled execution error: System.IO.FileNotFoundException: Could not find file 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'.
File name: 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
at guwpFnV83JfDxQ01Fu.EWEEOhEWhJTb9BlSI9.awJMrJJ0x(String[] )


In the path in the first line there is a double \ in between visual cron and Powershell, could this be the problem?
Support
7 years ago
Originally Posted by: Coconut01 

I've found this in the task log

ExecuteProcess("E:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 109)->System.IO.FileNotFoundException: Could not find file 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'.
File name: 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
ExecuteProcess("E:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 109)->Unhandled execution error: System.IO.FileNotFoundException: Could not find file 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'.
File name: 'E:\Scripts\AD_Account_Expiry\Scripts\Live script\test.ps1'
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
at guwpFnV83JfDxQ01Fu.EWEEOhEWhJTb9BlSI9.awJMrJJ0x(String[] )


In the path in the first line there is a double \ in between visual cron and Powershell, could this be the problem?



No, the problem is your PS1 file. I think you are connecting remotely and to not have the PS1 file at this specifc location.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top