ITMS Run Script on Task Server fails
search cancel

ITMS Run Script on Task Server fails

book

Article ID: 373166

calendar_today

Updated On:

Products

Client Management Suite

Issue/Introduction

Run script on task server fails with error message in SMP (Symantec Management Platform) Console:

An error occurred while attempting to launch the script

Environment

ITMS 8.X

Windows Server

Cause

After enabling trace logging for Task Management as per article:

How to enable trace logging for Task management (task server) on a site server

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)
 

Resolution

Provided Service account enough permissions to perform write action in C:\Windows\Temp