text
stringlengths
0
4.23k
-r <Remotecomputer>
Specifies the remote computer to configure.Important: If you use this parameter, you must make sure the Remote Registry service is running on the remote computer. If it isn't running, Windows displays a “Network Path Not Found” error message.
-u <domainname>\<username>
Specifies the domain and user account name to use while running the netsh command under a user account. If you omit the domain, the local domain is used by default.
-p <Password>
Specifies the password for the user account specified by the -u <username> parameter.
<NetshCommand>
Specifies the netsh command to run.
-f <scriptfile>
Exits the netsh command after running the specified script file.
/?
Displays help at the command prompt.
<Aliasfile>
<Context>
<Remotecomputer>
Important: If you use this parameter, you must make sure the Remote Registry service is running on the remote computer. If it isn't running, Windows displays a “Network Path Not Found” error message.
<domainname>\<username>
<Password>
-u <username>
<NetshCommand>
<scriptfile>
Remarks
If you specify -r followed by another command, netsh runs the command on the remote computer and then returns to the Cmd.exe command prompt. If you specify -r without another command, netsh opens in remote mode. The process is similar to using set machine at the Netsh command prompt. When you use -r, you set the target computer for the current instance of netsh only. After you exit and reenter netsh, the target computer is reset as the local computer. You can run netsh commands on a remote computer by specifying a computer name stored in WINS, a UNC name, an Internet name to be resolved by the DNS server, or an IP address.
If your string value contains spaces between characters, you must enclose the string value in quotation marks. For example, -r "contoso remote device"
-r "contoso remote device"
netstat
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, this command displays active TCP connections.
Important
This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections.
Syntax
netstat [-a] [-b] [-e] [-n] [-o] [-p <Protocol>] [-r] [-s] [<interval>]
Parameters
Parameter
Description
-a
Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.
-b
Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
-e
Displays Ethernet statistics, such as the number of bytes and packets sent and received. This parameter can be combined with -s.
-n
Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.
-o
Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on the Processes tab in Windows Task Manager. This parameter can be combined with -a, -n, and -p.
-p <Protocol>
Shows connections for the protocol specified by Protocol. In this case, the Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display statistics by protocol, Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.
-s
Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP, and IP protocols. If the IPv6 protocol is installed, statistics are shown for the TCP over IPv6, UDP over IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be used to specify a set of protocols.
-r
Displays the contents of the IP routing table. This is equivalent to the route print command.
<interval>
Redisplays the selected information every interval seconds. Press CTRL+C to stop the redisplay. If this parameter is omitted, this command prints the selected information only once.
/?
Displays help at the command prompt.
<Protocol>
<interval>
Remarks
The netstat command provides statistics for the following:
Parameter