You can use Portqry.exe to troubleshoot Microsoft Exchange Server issues where basic TCP/IP connectivity must be verified. This may be useful in environments that have firewalls. You can use Portqry.exe to verify connectivity to TCP/IP ports that are used by Exchange Servers for SMTP, POP3, IMAP, LDAP, RPC, NetBIOS, and DNS.
Note Version 2 of Portqry.exe is now available. The Microsoft Download Center link at the end of this article has been updated to reflect the new version. Version 1.0 of Portqry.exe has been removed from the Microsoft Download Center.
ListeningA process is listening on the port on the computer you choose. Portqry.exe received a response from the port.
Not ListeningNo process is listening on the target port on the target system. Portqry.exe received an Internet Control Message Protocol (ICMP) "Destination Unreachable - Port Unreachable" message back from the target UDP port. Or if the target port is a TCP port, Portqry received a TCP acknowledgement packet with the Reset flag set.
FilteredThe port on the computer you chose is being filtered. Portqry.exe did not receive a response from the port. A process may or may not be listening on the port. By default, TCP ports are queried three times and UDP ports are queried once before a report indicates that the port is filtered.
Portqry.exe can query a single port, an ordered list of ports, or a sequential range of ports.
Also, Portqry.exe displays "extended information" that is returned from some ports. Portqry.exe looks for "extended information" on ports where SMTP, POP3, IMAP4, and FTP services listen.
An example is SMTP. By default, SMTP listens on TCP port 25. When Portqry.exe finds that TCP port 25 on a target computer is LISTENING, it returns any "extended" information that the answering service provides.
ExamplesYou run the following command:
TCP port 25 (smtp service): LISTENING
Portqry is also capable of querying an LDAP service. It knows how to send an LDAP query (by using UDP and TCP) and interpret an LDAP server response to the query. The response from the LDAP server is parsed, formatted and returned to the user.
You run the following command:
Sending LDAP query to UDP port 389...
LDAP query response:
currentdate: 09/03/2001 05:42:40 (unadjusted GMT)
======== End of LDAP query response ========
UDP port 389 is LISTENING
Portqry.exe knows how to send a query to the RPC end-point mapper (by using UDP and TCP) and interpret the response. This query dumps all of the end points that are currently registered with the RPC end-point mapper. The response from the end-point mapper is parsed, formatted, and returned to the user. For example when you run the portqry -n myserver -p udp -e 135 command, Portqry.exe automatically resolves UDP port 135 by using the systemroot\system32\drivers\etc\services file that every Windows 2000 system has. If it resolves the port to the RPC End Point Mapper (EPMAP) service, it sends an unformatted user datagram to UDP port 135 on the target computer. Portqry.exe does not receive a response from the port because the RPC end-point mapper service only responds to a properly-formatted RPC query. Portqry.exe reports that the port is LISTENING or FILTERED. Portqry.exe then sends a properly-formatted RPC query to UDP port 135. This query dumps all of the end points that are currently registered with the RPC end-point mapper. If it receives a response to the query, it returns the entire response to the user and reports that the port is LISTENING. If Portqry.exe does not receive a response to the query, it reports that the port is FILTERED. An example of this occurs when you run the portqry -n mymailsrv -p udp -e 135 command:
UUID: 9e8ee830-4459-11ce-979b-00aa005ffebe MS Exchange MTA 'Mta' Interface ncacn_np:\\\\mymailsrv[\\pipe\\00000bbc.000]
UUID: 9e8ee830-4459-11ce-979b-00aa005ffebe MS Exchange MTA 'Mta' Interface ncacn_ip_tcp:169.254.112.100
UUID: 99e64010-b032-11d0-97a4-00c04fd6551d Exchange Server STORE ADMIN ncadg_ip_udp:169.254.112.100
UUID: 10f24e8e-0fa6-11d2-a910-00c04f990f3b Microsoft Information Store ncacn_np:\\\\mymailsrv[\\pipe\\00000ba0.000]
Total endpoints found: 5
==== End of RPC Endpoint Mapper query response ====
UDP port 135 is LISTENING
Portqry.exe is available for download from the Microsoft Download Center. To download Portqry.exe, visit the following Microsoft Web site:
Article ID: 310298 - Last Review: Dec 16, 2009 - Revision: 1