5

I don't actually need to perform any operations on the switch. I just need to verify it's there.

I have some remote servers that I need to verify have the blue serial console cable hooked up correctly. Rather than RDC into each of them and copy/configure putty just to hit enter a couple times, I'd like to use "enter-pssession" to remotely connect to PowerShell and access COM1 that way.

I've tried using this, but get no feedback on the console.

https://blogs.msdn.microsoft.com/powershell/2006/08/31/writing-and-reading-info-from-serial-ports/

Thanks!

7

Figured it out. Slap enter-pssession -computername XXXXXXX in front of this to remotely connect to a system to check.

$com = New-Object System.IO.Ports.SerialPort(“COM1”)
$com.open()
$com.write([char]13)
$com.ReadExisting()
3
  • This is neat. I almost wanted to tell you (tongue in cheek) to open up Powershell, and type "putty.exe" ;) – Ryan Ries Aug 24 '16 at 14:21
  • Hey, if putty would make a connection to a remote system first and then connect to the serial port, I would have marked your comment as the answer :-) – MathewC Aug 24 '16 at 14:31
  • Don't forget to mark it answered... – Xalorous Aug 24 '16 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.