Portqry Syntax
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
Portqry Syntax
PortQry uses the following syntax:
portqry /n name [/p protocol] [/e || /r || /o endpoint(s)] [/l logfile] [/s] [/q] [/i]
Parameters
- /n name
A required parameter used to specify the target system by host name or IP address. No embedded spaces are allowed in either. If PortQry attempts to resolve an IP address from a host name and cannot, then it reports an error and quits. If PortQry attempts to resolve a host name from an IP address and cannot, then it reports an error, but continues processing.
- /p protocol
An optional parameter that specifies the type of port or protocol used to connect to the target port. Valid entries for protocol are tcp, udp, or both. The default is TCP. If you set the option to BOTH, you must also specify the port number by using the /e parameter. PortQry then sends queries to both the TCP and UDP port specified by the /e parameter.
- /e port
An optional parameter. Use /e to query a single port within the valid range of 1-65535. The /e parameter cannot be used with /r or /o.
- /r start port:end port
An optional parameter. Use /r to specify a range of port numbers to be queried in sequential order within the valid range of 1-65535. No spaces are allowed between the port numbers and the colon. The /r parameter cannot be used with /o or /e.
- /o port,port,port...
An optional parameter. Use /o to query a series of port(s) in a specific order (not sequential), within the valid range of 1-65535. No spaces are allowed between port numbers and commas. The /o parameter cannot be used with /r or /e.
- /l filename
An optional parameter. Use /l to copy the PortQry output to a text (log) file in the directory where you are running PortQry. Filename is the name (with extension) of the log file. If a log file with the same name already exists, PortQry prompts you to specify whether you want the existing file overwritten.
- /s
An optional parameter. Use /s to request that Portqry wait longer for responses to UDP queries.
- /q
An optional parameter. Use /q to suppress all output to the screen other than error messages. The /q parameter can be used with /e, but not with /o, /r, or /p with the BOTH option. For more information about errorlevel reporting, see Portqry Remarks.
- /i
Bypasses default IP address-to-host-name lookup. This parameter is ignored unless an IP address is specified using the /n parameter. When an IP address is specified using /n, PortQry attempts to resolve the IP address to a host name. This process can be time consuming, particularly if the IP address cannot be successfully resolved. Specifying /i in this case allows you to bypass the default lookup, and instead, query the target port(s) immediately.
See Also
Concepts
Portqry Overview
Portqry Remarks
Portqry Examples
Alphabetical List of Tools
Spcheck Overview
Nltest Overview
Netdom Overview
Netdiag Overview
Netcap Overview
Httpcfg Overview
Dnslint Overview
Dnscmd Overview
Dhcploc Overview
Dcdiag Overview
Browstat Overview
Xcacls Overview
Sidwkr.dll
Sidwalker Security Administration Tools
Sidwalk Overview
Showaccs Overview
Sdcheck Overview
Ktpass Overview
Ksetup Overview
Getsid Overview
Addiag.exe