Select the product you need help with
New features and functionality in PortQry version 2.0Article ID: 832919 - View products that this article applies to. On This PageSummaryThis article discusses the new features and functionality that are available in PortQry Command Line Port Scanner version 2.0. PortQry version 1.22 is a TCP/IP connectivity testing utility that is included with the Microsoft Windows Server 2003 Support Tools. Microsoft has released a new version of PortQryV2.exe. This new version includes all the features and functionality of the earlier version and has new features and functionality. Note PortQry Command Line Port Scanner version 2.0 is no longer available to download. This article only introduces the features and functionality of it in case you have already downloaded it. OverviewPortQry is a command-line utility that you can use to help troubleshoot TCP/IP connectivity issues. This utility reports the port status of target TCP and User Datagram Protocol (UDP) ports on a local computer or on a remote computer. PortQry version 2.0 also provides detailed information about the local computer's port usage. PortQry version 2.0 runs on all the following operating systems:
Port status reportingPortQry reports the status of a port in one of the following ways:
PortQry version 2.0 featuresDepending on the process that listens on a UDP port, sometimes it may be difficult to determine the status of that UDP port. When an unformatted zero-length or fixed-length message is sent to a target UDP port, the port may or may not respond. If the port responds, it has a status of LISTENING. If you receive an ICMP "Destination unreachable" message from a UDP port, or if a TCP reset response is returned from a TCP port, the port has a status of NOT LISTENING. Typical port scanning tools report that the port has a LISTENING status if the target UDP port does not return an ICMP "Destination unreachable" message. This result may not be accurate for one or both of the following reasons:
When you troubleshoot a connectivity problem, especially in an environment that contains one or more firewalls, it is useful to know if a port is being filtered or if it is listening. PortQry includes some special features to help make this determination on selected ports. If there is no response from a target UDP port, PortQry reports that the port is LISTENING or FILTERED. PortQry then sends a correctly formatted message that the listening service or program understands. PortQry uses the correct session layer or application layer protocol to determine if the port is listening. PortQry uses the Services file that is located in the %SYSTEMROOT%\System32\Drivers\Etc folder to determine which service listens on each port. Note This file is stored on each Microsoft Windows Server 2003, Windows XP, and Windows 2000-based computer. Because PortQry is intended as a troubleshooting tool, it is expected that users who use it to troubleshoot a particular problem have sufficient knowledge of their computing environment. PortQry version 2.0 supports the following session layer and application layer protocols:
LDAP supportPortQry can send an LDAP query by using both TCP and UDP and interpret an LDAP server's response to that query correctly. PortQry parses, formats, and then returns the response from the LDAP server to the user. For example, you type the following command, and then press ENTER:portqry -n myserver -p udp -e 389 PortQry then performs the following actions:
Sample outputUDP port 389 (unknown service): LISTENING or FILTERED Sending LDAP query to UDP port 389... LDAP query response: currentdate: 12/13/2003 05:42:40 (unadjusted GMT) subschemaSubentry: CN=Aggregate,CN=Schema,CN=Configuration,DC=domain,DC=example,DC=com dsServiceName: CN=NTDS Settings,CN=myserver,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=domain,DC=example,DC=com namingContexts: DC=domain,DC=example,DC=com defaultNamingContext: DC=domain,DC=example,DC=com schemaNamingContext: CN=Schema,CN=Configuration,DC=domain,DC=example,DC=com configurationNamingContext: CN=Configuration,DC=domain,DC=example,DC=com rootDomainNamingContext: DC=domain,DC=example,DC=com supportedControl: 1.2.840.113556.1.4.319 supportedLDAPVersion: 3 supportedLDAPPolicies: MaxPoolThreads highestCommittedUSN: 4259431 supportedSASLMechanisms: GSSAPI dnsHostName: myserver.domain.example.com ldapServiceName: domain.example.com:myserver$@domain.EXAMPLE.COM serverName: CN=myserver,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=domain,DC=example,DC=com supportedCapabilities: 1.2.840.113556.1.4.800 isSynchronized: TRUE isGlobalCatalogReady: TRUE domainFunctionality: 0 forestFunctionality: 0 domainControllerFunctionality: 2 ======== End of LDAP query response ======== UDP port 389 is LISTENING Be aware that the LDAP test over UDP may not work against domain controllers that are running Windows Server 2008. To check the availability of the service that is running on UDP 389, you can use NLTEST instead of the PortQry tool. For example, you can use Nltest /sc_reset <domain name>\<computer name> to force a security channel onto a particular domain controller. For more information, visit the following Microsoft Web site: http://technet.microsoft.com/en-us/library/cc961803.aspx
(http://technet.microsoft.com/en-us/library/cc961803.aspx)
RPC supportPortQry can send an RPC query by using both TCP and UDP and interpret the response to that query correctly. This query returns (dumps) all the end points that are currently registered with the RPC endpoint mapper. PortQry parses, formats, and then returns the response from the RPC endpoint mapper to the user. For example, you type the following command, and then press ENTER:portqry -n myserver -p udp -e 135 PortQry then performs the following actions:
Sample outputUDP port 135 (epmap service): LISTENING or FILTERED Querying Endpoint Mapper Database... Server's response: UUID: 50abc2a4-574d-40b3-9d66-ee4fd5fba076 ncacn_ip_tcp:169.254.12.191[4144] UUID: ecec0d70-a603-11d0-96b1-00a0c91ece30 NTDS Backup Interface ncacn_np:\\\\MYSERVER[\\PIPE\\lsass] UUID: e3514235-4b06-11d1-ab04-00c04fc2dcd2 MS NT Directory DRS Interface ncacn_ip_tcp:169.254.12.191[1030] UUID: e3514235-4b06-11d1-ab04-00c04fc2dcd2 MS NT Directory DRS Interface ncadg_ip_udp:169.254.12.191[1032] UUID: 12345678-1234-abcd-ef00-01234567cffb ncacn_np:\\\\MYSERVER[\\PIPE\\lsass] UUID: 12345678-1234-abcd-ef00-01234567cffb ncacn_np:\\\\MYSERVER[\\PIPE\\POLICYAGENT] Total endpoints found: 6 ==== End of RPC Endpoint Mapper query response ==== UDP port 135 is LISTENING Note When you specify the -r option in the PortQry.exe command to scan a range of ports, the RPC End Point Mapper is not queried. This makes the scan of a range of ports faster. DNS supportPortQry can send a correctly formatted DNS query by using both TCP and UDP. PortQry sends a DNS query for the following fully qualified domain name (FQDN):portqry.microsoft.com PortQry then waits for a response from the destination DNS server. If the server returns a response, PortQry determines that the port is LISTENING.Note It is not important whether the DNS server returns a negative response. Any response indicates that the port is listening. NetBIOS name service supportBy default, the NetBIOS name service listens on UDP port 137. When PortQry determines that this port is LISTENING or FILTERED, PortQry performs the following actions to determine whether the port is actually listening:
SNMP supportSNMP support is a new feature in PortQry version 2.0. By default, the SNMP service listens on UDP port 161. To determine whether port 161 is listening, PortQry sends a query that is formatted in the way that the SNMP service accepts. The SNMP service is configured with a community name or a string that you must know to obtain a response from the server. With PortQry, you can specify SNMP community names when you query this port. By default, PortQry uses the community name, "Public." To specify a different community name, use the -cn command-line option. When you specify a community name in the PortQry.exe command, enclose that community name in exclamation marks (!). For example, to specify a community name such as secure123, type a command that is similar to the following command:portqry -n 127.0.0.1 -e 161 -p udp -cn !secure123! Sample outputQuerying target system called: 127.0.0.1 querying... UDP port 161 (snmp service): LISTENING or FILTERED community name for query: secure123 Sending SNMP query to UDP port 161... UDP port 161 is LISTENING ISA Server supportMicrosoft ISA Server support is a new feature in PortQry version 2.0. By default, ISA Server uses TCP port 1745 and UDP port 1745 to communicate with Winsock proxy clients and with firewall clients. Computers that have the Winsock proxy client program or the Firewall client program installed use these ports to request services from ISA Server and to download configuration information. Typically, these services include name resolution services and other services that are not HTTP-based (for example, Winsock connections). To determine whether the port is listening, PortQry sends a query that is formatted in the way that ISA Server accepts.Sample outputFor example, you type a command that is similar to the following command:portqry -n myproxy-server -p udp -e 1745 You receive the following output:Querying target system called: myproxy-server Attempting to resolve name to IP address... Name resolved to 169.254.24.86 querying... UDP port 1745 (unknown service): LISTENING or FILTERED Sending ISA query to UDP port 1745... UDP port 1745 is LISTENING Sample outputTCP port 1745 (unknown service): LISTENING Sending ISA query to TCP port 1745... ISA query response: 10.0.0.0 10.255.255.255 127.0.0.1 127.0.0.1 169.254.0.0 169.254.255.255 192.168.0.0 192.168.255.255 127.0.0.0 127.255.255.255 ; ; This file should not be edited. ; Changes to the client configuration should only be made using ISA Management. ; [Common] myproxy-server.example.com Set Browsers to use Auto Detect=1 AutoDetect ISA Servers=1 WebProxyPort=8080 Port=1745 Configuration Refresh Time (Hours)=2 Re-check Inaccessible Server Time (Minutes)=10 Refresh Give Up Time (Minutes)=15 Inaccessible Servers Give Up Time (Minutes)=2 [Servers Ip Addresses] Name=myproxy-server [My Config] Path1=\\myproxy-server\mspclnt\ ======== End of ISA query response ======== SQL Server 2000 supportMicrosoft SQL Server 2000 support is a new feature in PortQry version 2.0. PortQry queries UDP port 1434 to query all the SQL Server named instances that are running on a SQL Server 2000 computer. PortQry sends a query that is formatted in the way that SQL Server 2000 accepts to determines whether this port is listening.Sample outputFor example, you type a command that is similar to the following command:portqry -n 192.168.1.20 -e 1434 -p udp You receive the following output:Querying target system called: 192.168.1.20 querying... UDP port 1434 (ms-sql-m service): LISTENING or FILTERED Sending SQL Server query to UDP port 1434... Server's response: ServerName SQL-Server1 InstanceName MSSQLSERVER IsClustered No Version 8.00.194 tcp 1433 np \\SQL-Server1\pipe\sql\query ==== End of SQL Server query response ==== UDP port 1434 is LISTENING TFTP supportTFTP support is a new feature in PortQry version 2.0. By default, TFTP servers listen on UDP port 69. PortQry sends a query that is formatted in the way that the TFTP server accepts to determine whether this port is listening.Sample outputFor example, you type a command that is similar to the following command:portqry -n myserver.example.com -p udp -e 69 You receive the following output: Querying target system called: myserver.example.com Attempting to resolve name to IP address... Name resolved to 169.254.23.4 querying... UDP port 69 (tftp service): LISTENING or FILTERED Sending TFTP query to UDP port 69... UDP port 69 is LISTENING L2TP supportL2TP support is a new feature in PortQry version 2.0. Routing and Remote Access servers and other virtual private networking (VPN) servers listen on UDP port 1701 for inbound L2TP connections. PortQry sends a query that is formatted in the way that the VPN server accepts to determine whether this port is listening.Sample outputFor example, you type a command that is similar to the following command:portqry -n vpnserver.example.com -e 1701-p udp You receive the following output:Querying target system called: vpnserver Attempting to resolve name to IP address... Name resolved to 169.254.12.225 querying... UDP port 1701 (l2tp service): LISTENING or FILTERED Sending L2TP query to UDP port 1701... UDP port 1701 is LISTENING Customize ports that queries useBy default, every Windows Server 2003, Windows XP, and Windows 2000-based computer has a Services file that is located in the %SYSTEMROOT%\System32\Drivers\Etc folder. PortQry uses this file to resolve port numbers to their corresponding service names. The content of this file dictates the ports where PortQry sends formatted messages when you use the PortQry.exe command. You can edit this file to direct PortQry to send formatted messages to an alternative port. For example, the following entry appears in a typical Services file:Additional service information returnedPortQry displays extended information that some ports may return. PortQry looks for this "extended information" on ports where the following services listen:
Note You can change the service that PortQry determines is listening on a port by editing the Services file. For additional information, see the "Customize ports that queries use" section of this article. In this scenario, PortQry tries to use the Anonymous user account to log on to the FTP server. The result of this logon attempt indicates whether the destination FTP server accepts anonymous logons. PortQry returns the server's response. Example 1: You type a command that is similar to the following command, and then press ENTER: portqry -n MyFtpServer -p tcp -e 21 You receive a response that is similar to the following response:TCP port 21 (ftp service): LISTENING Data returned from port: 220 Microsoft FTP Service 331 Anonymous access allowed, send identity (e-mail name) as password. Example 2: You type a command that is similar to the following command, and then press ENTER: portqry -n MyMailServer -p tcp -e 25 You receive a response that is similar to the following response:TCP port 25 (smtp service): LISTENING Data returned from port: 220 MyMailServer.domain.example.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.0 ready at Mon, 15 Dec 2003 10:24:50 -0800 PortQry command-line optionsYou can use the following command-line options with PortQry:
Additional featuresPortQry version 2.0 includes the following new features:
PortQry interactive modeWith PortQry version 1.22, users can query ports from the command line in a command prompt window. When you troubleshoot connectivity issues between computers, you may have to type many repetitive commands. With PortQry version 2.0, you can run commands this way, but PortQry version 2.0 also has an interactive mode. The interactive mode is similar to the interactive functionality in the Nslookup DNS utility or in the Nblookup WINS utility.To start PortQry in interactive mode, use the –i option. For example, type portqry -i. When you do so, you receive the following output: Portqry Interactive Mode Type 'help' for a list of commands Default Node: 127.0.0.1 Current option values: end port= 80 protocol= TCP source port= 0 (ephemeral) > portqry -i -e 53 -n 192.168.1.20 -p both –sp 2030 You receive the following output:Portqry Interactive Mode Type 'help' for a list of commands Default Node: 192.168.1.20 Current option values: end port= 53 protocol= BOTH source port= 2300 PortQry local modeThe PortQry local mode of operation is designed to give you detailed information about the TCP ports and the UDP ports on the local computer where PortQry runs. PortQry has the following three basic commands available in local mode:
References
For additional information about how to use PortQry, click the following article numbers to view the articles in the Microsoft Knowledge Base:
310099
(http://support.microsoft.com/kb/310099/
)
Description of the Portqry.exe command-line utility
310456
(http://support.microsoft.com/kb/310456/
)
How to use Portqry to troubleshoot Active Directory connectivity issues
310298
(http://support.microsoft.com/kb/310298/
)
How to use Portqry.exe to troubleshoot Microsoft Exchange Server connectivity issues
310513 Important The PortQueryUI tool provides a graphical user interface and is available for download. PortQueryUI has several features that can make using PortQry easier. To obtain the PortQueryUI tool, visit the following Microsoft Web site:
(http://support.microsoft.com/kb/310513/
)
How to make Portqry.exe only report listening ports
http://download.microsoft.com/download/3/f/4/3f4c6a54-65f0-4164-bdec-a3411ba24d3a/PortQryUI.exe
(http://download.microsoft.com/download/3/f/4/3f4c6a54-65f0-4164-bdec-a3411ba24d3a/PortQryUI.exe)
PropertiesArticle ID: 832919 - Last Review: August 23, 2012 - Revision: 5.0 Applies to
| Article Translations
|


Back to the top








