I have some embedded network devices I need to configure. Right now I don't know their IP addresses, and obtaining them is something I can do in PowerShell (I think). Once I get the IP addresses, I'd like to Telnet (and possibly SSH) into them to execute some commands, possibly interpret their feedback, and if I interpret their feedback, eventually save it to a file.
Which I'd have figured PowerShell could do. I haven't found a way yet. Or maybe I'm looking for something too basic and everyone implies that the myriad of tools and discussions obviously can handle something so trivial, and I am just missing it.
Is there a program, PowerShell module, or similar software, to script telnet connections and commands? It doesn't have to literally be telnet.exe, just an interactive shell connection, where I can send commands, interpret results, and then save to a file.
Required features
- Telnet to an arbitrary port
- SSH to an arbitrary port
- Add a delay so the endpoint can process the connection or command
- Manipulate the responses; pull out relevant info
- Save to a file
- Allow for multiple concurrent connections
- Free, gratis, or low cost software
- Preferably no install on the machine to runt he scripts (Windows/Power Shell native), portable (self contained), or a complete installer with no other dependencies.
- Runs on Windows, including Windows Server
- If not PowerShell, needs robust scripting language capabilities
Thus far I've come across various random "script it with VB" or "script it with this obscure scripting language [that would require all this other software to be installed]". I'd prefer to use Power Shell, but I don't think Power Shell can do all of what I want. I came across the module Get-Telnet, but that isn't working for me (I haven't figured out how to parse the output while still running the script to later save to a file). I found this blog post, and many similar, looking for the same thing.
In my mind, what I am looking for is ridiculously basic, and I should be tripping over qualified softwares, like I would if I wanted an FTP client. It's clear that many people are looking for something similar,
I've come across a lot of recomendations and discussions, and they are grossly over-complicated, or can't see the forest for the trees. Meaning, their webpages go on and on and on about things that are not relevant to my search, nor do I even know what some of the features would be used for, or seem to require gobs of extra software to work. This is clearly a gross oversimplification, painted with a broad brush.
- Automating Telnet with PowerShell
- Automating Telnet Script
- Is it possible to use a batch file to establish a telnet session, send a command and have the output written to a file?
- Scripting windows Telnet
- Automate telnet commands from DOS
- SSH.NET
- Posh-SSH: Open Source SSH PowerShell Module
- SSH Client using PowerShell
- SSH PowerShell Module
- How can I automate telnet port 25 testing?
- Telnet automation / scripting
- Creating a script for a Telnet session?
- Run SSH with PowerShell
Other relevant links I came across while on my search
/dev/tcp
files?