1

Why does powershell -command "Restart-Service Tomcat6" fail when run from a Scheduled Task?

view story
linux-howto

http://serverfault.com – I get the following error in the Scheduled Task history when I try to run a task: Task Scheduler successfully completed task "\Restart Tomcat" , instance "{264b4620-5f3b-6c5f-a6cb-1625a7fa57de}" , action "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.EXE" with return code 1. The scheduled task is configured as follows: Name: Restart Tomcat User: DOMAIN\tomcat.restarter Triggers: Daily 2AM Enabled Actions: Start a Program: Program/script: powershell Arguments: -Command "Restart-Service Tomcat6" When I launch a Command Prompt as DOMAIN\tomcat.restarter with: runas /user:DOMAIN\ (HowTos)