The local user account that logs into the remote agent does not inherit/pass the user variable information while executing hexecp on that remote agent.
search cancel

The local user account that logs into the remote agent does not inherit/pass the user variable information while executing hexecp on that remote agent.

book

Article ID: 53214

calendar_today

Updated On:

Products

CA Harvest Software Change Manager - OpenMake Meister CA Harvest Software Change Manager CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

The local user account that logs into the remote agent does not inherit/pass their profile and user variable information while executing hexecp on that remote agent.  For example:

On the remote agent machine, the user "testuser1" has a special environment variable defined in their profile:

[testuser1@example-agent ~]$ echo $MY_SPECIAL_ENV_VAR
HelloWorld


However, when testuser1 executes the same command using hexecp from the broker machine, he gets a different result:

C:\Users\<userid>>hexecp -m example-agent -rport 6000 -prg "echo $MY_SPECIAL_ENV_VAR" -syn
Please enter the username and password for olnx84-orcl19c.
USERNAME:  testuser1
PASSWORD:  ***********
Attempting to log into remote agent...
Connected to remote agent.
$MY_SPECIAL_ENV_VAR
Execution of program: echo $MY_SPECIAL_ENV_VAR was successful.
hexecp has been executed successfully.


What actions should you take to ensure your remote program inherits the local account user environment variables?

Environment

Harvest Software Change Manager v12.x and higher

Cause

The reason for this is that hexecp executes with the profile and environment variables that were in place when Harvest was installed on the agent server. 

Resolution

To ensure the user's profile and environment variables are used when executing through hexecp to the remote agent computer the best solution is to embed within the script that hexecp executes, a script or set of commands that would setup the correct profile and environment variables required by the remote program.