Wokflow fails with error
2713 CommandActivity : [ForEach(0)->Uncheck enable mediaagent (ExecuteCommand_1)] executing command [qoperation execscript -sn setMediaAgentProperty -si MA1 -si 9 -si 0] with arguments  on host [whmm65519] as user [groupinfra\a-********]
2713 CommandActivity : [ForEach(0)->Uncheck enable mediaagent (ExecuteCommand_1)] ERROR: error executing command [qoperation execscript -sn setMediaAgentProperty -si whmm65529 -si 9 -si 0] on host [MA1], errorCode , exitCode , error [execscript: Error 0x10b: User not logged in
I tried using qlogin before teh workflow.We still get same error
Attached the xml file
Best answer by RMcG
The reason you are getting the ‘User not logged in error’ is that you need to provide a token to the qoperation command to use. Even though you tried a QLogin earlier you need to keep in mind that each ‘Execute Command’ activity in the workflow is establishing a new session with the client. Session state is not maintained across the activities.
You could pass the token you retrieve using a workflow variable and the -tk parameter for the qoperation command. A simpler way though is to just use the ‘ExecuteScript’ workflow activity (under the qcommand section) instead. Then you don’t need to think about it and the qscript will execute using the credentials of the current user executing the workflow.
I’ve attached a modified version of the workflow replacing a the first two Execute Command activities with the ExecuteScript activity as an example. You’ll need to download the xml file and import it (eg don’t view and copy the xml via the browser as it won’t work properly that way).