NetCmdlets 2016
NetCmdlets 2016
Questions / Feedback?

Invoke-Telnet Cmdlet

Parameters   Output Objects   Configuration Settings  

The Invoke-Telnet cmdlet is used to remotely execute a command on a Telnet server.

Syntax

Invoke-Telnet [parameters]

Remarks

This cmdlet establishes a telnet connection to a server which starts up the user's default shell. Using the cmdlet is very simple. The destination is specified by Server and the remote shell's prompt is specified by ShellPrompt. In order to specify the authentication credentials, set the Credential parameter.

Command contains the command you wish to execute on the remote machine. The output of the command is returned in one or more TelnetResponse objects.

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.


# execute a simple command
invoke-telnet $server -user $username -password $password -command "ls -la" -shellprompt "bash-2.05a$ " -eol "`r`n" | foreach-object{$_.Text}

Connection Handling

This cmdlet supports persistent connections through the Connection parameter. To establish a new Telnet connection, use the Connect-Telnet cmdlet. To close the connection, use the Disconnect-Telnet cmdlet.

Parameter List


The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.

ConnectionAn already established connection.
LogFileThe location of a file to which debug information is written.
CommandThe command to be sent to the server.
ConfigSpecifies one or more configuration settings.
CredentialThe PSCredential object to use for user/password authentication.
EOLThe EOL used to parse the response.
FirewallHostName or IP address of firewall.
FirewallPasswordA password if authentication is to be used when connecting through the firewall.
FirewallPortThe port of the firewall to which to connect.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
LocalIPThe IP address of the local interface to use.
LogFileThe location of a file to which debug information is written.
LoginPromptThe format of the prompt for the user's login.
NoAuthenticationDisables authentication during connection.
PasswordThe password to use for authentication.
PasswordPromptThe format of the prompt for the user's password.
PortThe port to be used.
ServerThe address of the Server.
ShellPromptThe shell prompt on the remote shell on which the telnet connection is established.
ShellPromptExpressionA regular expression to match the shell prompt returned by the server.
TimeoutThe maximum time allowed for the operation.
UserThe 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.

TelnetResponseObject containing part or all of the response from server.

Configuration Settings


The following is a list of configuration settings for the cmdlet with short descriptions. Click on the links for further details.

ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the cmdlet whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe TCP port in the local host where the cmdlet binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
UseIPv6Whether to use IPv6.
TcpNoDelayWhether or not to delay when sending packets.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
CodePageThe system code page used for Unicode to Multibyte translations.

 
 
Copyright (c) 2017 /n software inc. - All rights reserved.
NetCmdlets 2016 - Version 16.0 [Build 6335]