Running commands on the target from the command line

Use the wrcmdpcr command to connect to a target and run a non-interactive command-line command.

About this task

You can specify the command that you want to run on the target, and the output from that command is displayed on the computer that the command is started from. This command can be useful for debugging a target when you do not have access to the IBM® BigFix® Remote Control Server user interface.

To start a command on a target, complete the following steps:

Procedure

  1. At a command prompt, go to the directory where you installed the command-line tools.
  2. Type in the following command
    wrcmdpcr user:password Rctarget command [argument ...]
    user:password
    Use to specify a valid user ID and password that you would use to log on to the IBM BigFix Remote Control Server.
    Rctarget
    Use to specify the computer name or the IP address of the target that you want to connect to and run a command on. It has the following syntax:

    @Endpoint:<computername or ipaddress>

    command
    Use to specify a command that runs from the command line. For commands that are built into the operating system's shell and do not have a binary executable file. For example, dir or tree in a Windows™ operating system. In a Linux™ operating system, cd or echo. You must also add the command shell command.
    Windows systems
    You must type cmd /c before the command. For more information, seeExamples of usage.

    For example, cmd /c dir

    Linux systems
    You must type sh -c before the command. For more information, see Examples of usage.
    Note:
    1. The command that you run must be specific to the operating system that is running on the target. If you are entering the command from a Windows computer to a target that has a Linux operating system installed, you must specify the Linux command.
    2. If you are entering the command from a Linux computer to a target that has a Windows operating system installed and you are using path names in the argument, you must use a double backslash in the argument. For example, \\windows.
    3. The command that you want to run must be in the PATH statement of the target, otherwise the full path to the command must be used.
    argument
    Use to provide arguments for the command that you want to run on the target.