I am trying to create a scheduled task on a Windows 2003 server from a Windows 2008 server using a PS script which runs the scheduled task create command. The Win 2003 servers do not have PS installed on them, and we won’t be doing that.
This command works perfectly from the console:
$result = & “C:\Windows\System32\schtasks.exe” /create /s $server /TN $taskname /ST $TaskTime /SC ONCE /F /RL Highest /TR $script /RU $guestuser /RP $guestPassword.
However, I am using the WebCommander Fling which makes the call using PHP. Once I run it through there I get ERROR: Access is denied which I pretty darn sure is coming from the scheduled task.
Does anyone know PHP well enough to tell me why this would not work via PHP? It is being executed via an EXEC command. Hope someone can help, I have been struggling way to long on this!