Invoke-Rexec Cmdlet
Parameters Output Objects Configuration Settings
The Invoke-Rexec cmdlet is used to execute commands on a remote UNIX machine using the rexec mechanism.
Syntax
Invoke-Rexec [parameters]
Remarks
This cmdlet allows remote execution of commands on UNIX hosts, or any other system with the rexec interface. Using the cmdlet is very simple. The destination is specified by Server, and the login information is given by Credential. Command contains the command you wish to execute on the remote machine. The output of the command is returned in one or more Shell objects.
To be able to successfully use the cmdlet, the remote host must be set up to allow execution of commands via rexec from the machine the cmdlet runs on.
The cmdlets support pipeline input for some of their parameters. Prebuilding an object and piping it to the cmdlet is very useful, but should be used with caution to prevent security conflicts. Steps have been taken to decrease the risk of a possibly accidental pipe to the cmdlet, for instance, the Credential parameter cannot be piped to the cmdlet and must be specified manually.
invoke-rexec -server YourServer -credential $mycred -command
"C:\WINDOWS\system32\cmd.exe /c dir c:\"
Parameter List
The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.
LogFile | The location of a file to which debug information is written. |
Command | The command to be sent to the server. |
Config | Specifies one or more configuration settings. |
Credential | The PSCredential object to use for user/password authentication. |
FirewallHost | Name or IP address of firewall. |
FirewallPassword | A password if authentication is to be used when connecting through the firewall. |
FirewallPort | The port of the firewall to which to connect. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
LocalIP | The IP address of the local interface to use. |
LogFile | The location of a file to which debug information is written. |
Password | The password to use for authentication. |
Port | The TCP port in the remote host to connect to. |
Server | The address of the Server. |
Timeout | The maximum time allowed for the operation. |
User | The username to use for authentication. |
Output Objects
The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.
Shell | Object containing stdout data returned from the Server . |
Configuration Settings
The following is a list of configuration settings for the cmdlet with short descriptions. Click on the links for further details.
EnableStderr | Enables or disables secondary (stderr) stream. |
StderrPort | The local port from which the remote system sends the stderr stream. |
MaxStdout | Maximum storage available for the stdout buffer. |
MaxStderr | Maximum storage available for the stderr buffer. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the cmdlet whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the cmdlet binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
ProxyExceptionsList | A semicolon separated list of hosts and IPs to bypass when using a proxy. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
UseBackgroundThread | Whether threads created by the cmdlet are background threads. |
UseInternalSecurityAPI | Tells the cmdlet whether or not to use the system security libraries or an internal implementation. |