Telnet Mass Configuration

Welcome Forums General PowerShell Q&A Telnet Mass Configuration

This topic contains 3 replies, has 3 voices, and was last updated by

10 months ago.

  • Author
  • #99381

    Points: -37
    Rank: Member

    Hi people

    Someone has needed to connect and send many commands to a switch/router? My ideia would be a txt file with hosts list and other file with command.

    I have part of that file but I need to inform the host and commands individually.

    The script have a function named get-telnet and we call that like below:

    Get-Telnet -RemoteHost "" -Commands "user","password","stuff","stuff","config","ip snmp-server community comm rw ","sntp client","no sntp server all","sntp server","clock timezone BR -3","end","copy runn startup" -OutputPath  "C:\Users\Scripts\output.txt" -WaitTime 1000

    I found the function researching into web. Here the source:

    Thank you for the help.
    Thank you.

  • #99391

    Points: 305
    Helping Hand
    Rank: Contributor

    Not really sure what your question is?

    Looking at your example do you mean that the remote hosts are in one file and the commands are in another?
    And you want to grab those two files as a source to use the Get-Telnet with?
    If so are there multiple hosts that are going to use the same commands or are they 1:1?

    • #99396

      Points: -37
      Rank: Member

      Hi Fredrik,

      Thanks for your reply. Actually I need (would like to) get de hosts and commands both in a files, but, if that is not possible, to get the host list and the commands into script will be works fine.


  • #99399

    Points: 398
    Helping Hand
    Rank: Contributor

    Then, I suppose the simplest approach would be to have two files:

    $RemoteHosts = Get-Content '//path/to/hosts/file.txt'
    $Commands = Get-Content '//path/to/commands/file.txt'
    $RemoteHosts | ForEach-Object {
        Get-Telnet -RemoteHost $_ -Commands $Commands

    This assumes you are supplying the same commands to each remote host.

The topic ‘Telnet Mass Configuration’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort