Name that Port, Powershell Style!

Friday, August 21, 2009

In a previous post, I presented a VBScript that displays the service assigned to common port numbers. You can also enter a search string to find any ports whose service (protocol) contain the search string.

Richard Siddaway suggested that the script should be written in Powershell instead, so here it is: Get-Port.ps1

Usage:

Get-Port.ps1 portnumber
This command gets the specified port number and displays the associated service

Get-Port.ps1 searchstring
This command displays all ports and services that match the search string. Searchstring is case insensitive.

4 comments:

  1. Yeah... so the link does not work under Chrome. Haven't tried IE yet.

    ReplyDelete
  2. Turns out that Windows was preventing the download. I repackaged it as a ZIP file and the link works now. Thanks for bringing that to my attention.

    ReplyDelete
  3. Looking to Open Ports to a Windows 2008 Server....any Powershell Script for that?

    ReplyDelete
  4. Take a look at http://blogs.technet.com/b/jamesone/archive/2009/02/18/how-to-manage-the-windows-firewall-settings-with-powershell.aspx

    ReplyDelete

Thank you for your comment! It is my hope that you find the information here useful. Let others know if this post helped you out, or if you have a comment or further information.