Using the Run Program for the Remote Host
13 min
about the run program docid\ gnceztramzlrgkk1zicuwhow the run program works docid\ gnceztramzlrgkk1zicuwusing windows remote management (winrm) setup docid\ gnceztramzlrgkk1zicuwusing the run program docid\ gnceztramzlrgkk1zicuwconfiguring the run program docid\ gnceztramzlrgkk1zicuwusing the run program / export history workspace docid\ gnceztramzlrgkk1zicuwexample starting or stopping a service using the run program docid\ gnceztramzlrgkk1zicuw about the run program remote connections are set up to connect to remote computers using the run program the run program is a way to execute a microsoft windows application from this is useful when you need to execute a program to accomplish a task that cannot be automated within itself some examples might include running powershell scripts to manage active directory user passwords, importing information from into a third party application, or running an xsl transformation using microsoft excel server performance can be severely affected if the run program job uses a lot of resources we recommend that you have a separate remote host server and not run it on the application or database servers how the run program works the run program uses the microsoft windows remote management (winrm) protocol this native service of windows allows remote requests to run local applications when enabled on a server, can make a request to run the specified program on that server, using the credentials supplied in the remote connection when the program is run, it can pass along details from as command line parameters, and any output can be returned to the quick action to update winrm is not enabled by default to enable this service in a secure manner, review http //msdn microsoft com/en us/library/aa384372(v=vs 85) aspx http //msdn microsoft com/en us/library/aa384372(v=vs 85) aspx secure connections use ssl certificates, either self signed or from a trusted authority using windows remote management (winrm) setup before configuring winrm, we strongly recommend that you review the security implications of each mode you must have an account with sufficient permissions to use winrm before starting the configuration running the program on the application server docid\ gnceztramzlrgkk1zicuwrunning the program on another server docid\ gnceztramzlrgkk1zicuw running the program on the application server check your application requirements winrm 2 0 and powershell 2 0 or newer are required on the application server or on the server where the run program is executed check if powershell is installed on the application server on which the software integration service is hosted in windows, go to start > all programs > accessories and check to see if the windows powershell folder exists if not, install it per instructions from microsoft windows powershell folder check to see if winrm is running by doing the following a run the powershell command module as an administrator b enter get service winrm windows powershell command module c the status should show running if not, go to services , change the startup to automatic, then start the service there are two modes trusted and secure (using an ssl certificate) trusted mode register the remote server as "trusted host" ( note do not copy and paste enter it manually ) run the powershell command module as an administrator enter winrm set winrm/config/client '@{trustedhosts="ca d02539 na frs"}' powershell trusted mode setup secure mode (using an ssl certificate) register the remote server certificate using mmc (if necessary) powershell secure mode setup running the program on another server use the following steps when using another program to execute the run program check your application requirements winrm 2 0 and powershell 2 0 or newer are required on the application server or on the server where the run program is executed check if powershell is installed on the application server on which the software integration service is hosted in windows, go to start > all programs > accessories and check to see if the windows powershell folder exists if not, install it per instructions from microsoft in the powershell command module, enable the powershell remoting capability by doing the following a enter enable psremoting force this initiates windows to configure the machine for listener ports and firewall rules enabling the powershell remoting capability example 1 port 5986 is the default https port used by winrm to receive the remote commands b enter winrm get winrm/config to check the configuration enabling the powershell remoting capability example 2 create a firewall inbound rule for the port firewall inbound rule get a server certificate for authentication purposes trusted root server certificate get the certificate thumbprint to configure the winrm listener (in the next step) export the public key to register it in the integration server certificate thumbprint configure the winrm listener run the windows command prompt as an administrator by doing the following a enter winrm create winrm/config/listener?address= +transport=https @{hostname="ca d02539 na frs"; certificatethumbprint="3d448fe37734a891d5876b5c51083c8a79ec0dcb"} if successful, the listener shows the port and certificate thumbprint b enter winrm enumerate winrm/config/listener to check the listener checking the winrm listener using the run program configure winrm on a server create a remote connection in the configuration console (see configuring the run program docid\ gnceztramzlrgkk1zicuw below ) the remote connection contains all the details necessary to connect to the remote server, including a valid user name and password to access resources on that server create a quick action that specifies the details of the program to execute and the parameters to pass to it (see run program action docid\ iqa5x1mwz7dewouc1abfv under default quick actions ) run program quick action as noted in the diagram, a tcp connection is required between the server and the remote management server if these two servers are separated across a wide area network or the internet (such as is the case for cloud), additional firewall configuration or a point to point vpn tunnel may be required configuring the run program access the data integration wizard by going to the configuration console and clicking extend > integration tools click start next to run program remote host the remote host connection manager workspace appears any configured connections are listed click add new\ the remote host connection setting page appears remote host connection setting page enter information into the fields field description connection name a unique, descriptive name for this connection remote host the fully qualified domain name or ip address for example, pl computer/na or 101 12 204 155 secure mode obtains a secure connection when this option is selected, the certificate options appear port number the default port number appears, based on whether secure mode is checked or not to override, enter another port number certificate allow self signed bypasses the untrusted certificate notification and prevent an error message allow mismatched name specifies a different remote host name than the https certificate is for (such as when connecting using an ip address instead of the host name on the certificate) you should not need to check this option if you are using a certificate from a trusted public authority, such as verisign and use the fully qualified domain name timeout (in seconds) wait for program to finish the number of seconds to wait for the program to respond by default, this is controlled by the integration service client and is 60 seconds to wait for an unlimited time, enter zero if the wait time is exceeded, a timeout error occurs authentication login the login user name to the remote host password the password to the remote host click test connection to see if you have a good connection click save your connection is added to the list in , open the run program / export history workspace to view the run program log sample run program log using the run program / export history workspace the run program / export history workspace in the application lists each time the run program quick action has been run and the result it is a convenient way for you to determine if your exports are working from the configuration console, click monitor > application logs > run program history to open the run program / export history workspace the log level column shows the success or failure of the run program quick action double click an item from the list to view the audit history example starting or stopping a service using the run program this example shows how to create a quick action that starts or stops a service create a run program connection within the data integration wizard see using the run program for the remote host docid\ gnceztramzlrgkk1zicuw create a quick action that is triggered by a user to start or stop a service through the run program connection see run program action docid\ iqa5x1mwz7dewouc1abfv the following are examples of the power shell scripts used to start and stop the services start script \##################################################################### \# startservice ps1 \# \# starts service remote script \##################################################################### if ($args length eq 0) { return "syntax error please provide 'service name' that you want to start!" } else { start service $args\[0] warningaction\ silentlycontinue return \[string] \ format ("\[ ] started ", $args\[0]) } stop script \##################################################################### \# stop service ps1 \# \# stops service \##################################################################### if ($args length eq 0) { return "syntax error please provide 'service name' that you want to stop!" } else { stop service $args\[0] warningaction\ silentlycontinue return \[string] \ format ("\[ ] stopped ", $args\[0]) } copy each script into a text editor and save them enter the file name of the script in the program with path field of the quick action
