After enabling trace logging for Task Management as per article:
The following entry can be found in the logs:
(Start) request: completed for task instance '<TaskName>' (<GUID>), thread=44776359,status=Completed, success=False, return code=-1
output properties:
name=@Exception, value=Altiris.ClientTask.Server.TaskServerScriptTaskException: Unable to execute script ---> Altiris.ClientTask.Server.TaskServerScriptTaskException: Unable to write script to a temporary file ---> System.UnauthorizedAccessException: Access to the path 'C:\Windows\Temp\<RandomGUIDvalue>.ps1' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path)
at Altiris.ClientTask.Server.ScriptTaskServerTaskHandler.WriteScriptFile(String scriptText)
--- End of inner exception stack trace ---
at Altiris.ClientTask.Server.ScriptTaskServerTaskHandler.WriteScriptFile(String scriptText)
at Altiris.ClientTask.Server.ScriptTaskServerTaskHandler.ExecuteScript(String command, String parameters, String username, String password, String scriptText, ProcessWindowStyle windowStyle)
--- End of inner exception stack trace ---
at Altiris.ClientTask.Server.ScriptTaskServerTaskHandler.ExecuteScript(String command, String parameters, String username, String password, String scriptText, ProcessWindowStyle windowStyle)
at Altiris.ClientTask.Server.ScriptTaskServerTaskHandler.OnExecute(String clientAgentHandlerXml, ParameterValueCollection inputParameters)
name=@ExceptionType, value=ScriptExecutionException
This indicates that the service account does not have enough permissions to write into Windows\Temp (in example log powershell script was used thus PS1 extension, in case Batch is used, extension will be .bat)