After the command script executes successfully on the remote computer, it is deleted. If you do not specify the working-dir attribute in the element and is "local" in the adapter configuration, the command script is copied and executed on the \\target-IP\Admin$ folder on the remote computer.XML sample of the Windows Command adapter request to execute a batch script using a relative path The following figure shows an XML sample of the Windows Command adapter request to execute a batch script using a relative path.
The element must be set to "remote" in the adapter configuration if you want to specify a relative path in the command. It does not transfer the script from the peer to the remote computer. When a relative path is specified in the adapter request, the Windows Command adapter searches for the script in the working directory on the target computer. Systeminfo /s remotehost /u domain\user /p pwd /fo CSV XML sample of the Windows Command with systeminfo command You must include the domain information in the systeminfo command only if you want to execute the command on a remote host. The following figure shows an XML sample of the adapter request for the Windows Command adapter with the systeminfo command. The adapter appends cmd /c to the beginning of the command as needed. The command must be entered as if it were being keyed at the system prompt. Specifies the mode to launch the xCommand service on a remote systemīy default, the xCommand utility is launched on 32-bit mode. When we specify as true, the SCM API is invoked with the user specified in the adapter request or configuration. If set to true, the Service Control Manager (SCM) API is invoked with the user specified in the adapter request or configuration.īy default, the xCmd utility runs under the security context of the BAO service running under a user account. This account would have been configured with the necessary permissions to access a network resource, something the service would not be able to do otherwise.For more information about how user impersonation works, see Impersonation Specifies whether to enable the user impersonation and allow the specified user to execute tasks by using the security context of another user (For example, BAO service running under a user account)įor example, a service running as LocalSystem could access network resources by impersonating a specific user account. "C:\My Scripts Folder\mycommand.bat" "C:\my data1" "C:\my data2" If a command contains parameters with spaces, the parameters must be enclosed in double quotation marks (" ").If the name of the script file has spaces, the script file name and the path must be enclosed in double quotation marks (" ").Commands can include a space-separated list of parameters.
Valid values for encryption-type: Base64, Plain (default)Īlso called character set, it includes identifiers describing a series of universal characters.
The element can contain an encryption-type attribute that indicates whether the password specified is encrypted. Specifies the password that corresponds to the provided or that used for remote host authentication This element applies to a dynamic target computer.Ĭonditional required based on your environment Specifies the user name to be used for remote host authentication This element applies to a dynamic target.Ĭonditional required when defining a dynamic target host Specifies the host name or the IP address of the remote host If you do not provide the value, the default target in the adapter configuration is used. Conditional required if a target is referenced or defined in the requestĬontains the name attribute that references a configuration node from the adapter configuration, or contains the elements that define a dynamic target computer