Testing Network Port Access

While configuring IMAPS access to an Exchange 2013 server recently, I found the following utilities extremely useful while testing firewall configurations.

To test port access on a remote (or local) system, you can use PortQry (on Windows) or Netcat (on Linux/MacOS):

PortQry (Download from Microsoft)

#Syntax/Example
portqry.exe -n <sub.domain.com> -p <protocol> -e <port>
portqry.exe -n mail.domain.com -p TCP -e 993

#Successful result
cmd.exe> PortQry.exe -n mail.domain.com -p TCP -e 993
...
TCP port 993 (imaps service): LISTENING

Netcat (included with MacOS/Linux)

#Syntax/Example
nc -zv <sub.domain.com> <port>
nc -zv mail.domain.com 993

#Successful result
MAC-Terminal:~ Username$ nc -zv mail.domain.com 993
...
Connection to mail.domain.com port 993 [tcp/imaps] succeeded!