netsh netsh
Применяется к: Windows Server (Semi-Annual Channel), Windows Server 2016 Applies to: Windows Server (Semi-Annual Channel), Windows Server 2016
Служебная программа для работы со сценариями командной строки сетевой оболочки, которая позволяет локально или удаленно отображать или изменять конфигурацию сети текущего компьютера. The Network Shell command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a currently running computer. Эту программу можно запустить в командной строке или в Windows PowerShell. You can start this utility at the command prompt or in Windows PowerShell.
Синтаксис Syntax
Параметры Parameters
Параметр Parameter | Описание Description |
---|---|
-a -a | Указывает, что вы вернетесь в командную строку Netsh после запуска Алиасфиле и имя текстового файла, содержащего одну или несколько команд Netsh. Specifies that you are returned to the netsh prompt after running Aliasfile and the name of the text file that contains one or more netsh commands. |
-c -c | Указывает, что команда Netsh вводит указанный контекст netsh и контекст Netsh для ввода. Specifies that netsh enters the specified netsh context and the netsh context to enter. |
-r -r | Указывает удаленный компьютер для настройки. 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. Если он не работает, Windows выводит сообщение об ошибке «сетевой путь не найден». If it isn’t running, Windows displays a “Network Path Not Found” error message.
Комментарии Remarks
Если вы указали параметр -r , а затем еще одну команду, netsh выполняет команду на удаленном компьютере, а затем возвращается в Cmd.exe командной строке. 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. Если указать параметр -r без другой команды, команда Netsh откроется в удаленном режиме. If you specify -r without another command, netsh opens in remote mode. Процесс аналогичен использованию параметра set machine (задать компьютер) в командной строке Netsh. The process is similar to using set machine at the Netsh command prompt. При использовании параметра -r целевой компьютер задается только для текущего экземпляра Netsh. When you use -r, you set the target computer for the current instance of netsh only. После выхода и повторного ввода netsh целевой компьютер будет перенастроен в качестве локального компьютера. After you exit and reenter netsh, the target computer is reset as the local computer. Команды netsh можно выполнять на удаленном компьютере, указывая имя компьютера, хранящееся в WINS, имя UNC, имя в Интернете, которое должно быть разрешено сервером DNS, или IP-адрес. 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. Например -r «contoso remote device» . For example, -r «contoso remote device»
Netsh http commands
Use netsh http to query and configure HTTP.sys settings and parameters.
If you are using Windows PowerShell on a computer running Windows Server 2016 or Windows 10, type netsh and press Enter. At the netsh prompt, type http and press Enter to get the netsh http prompt.
В В В В В В В netsh http>
The available netsh http commands are:
add iplisten
Adds a new IP address to the IP listen list, excluding the port number.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
ipaddress | The IPv4 or IPv6 address to be added to the IP listen list. The IP listen list is used to scope the list of addresses to which the HTTP service binds. «0.0.0.0» means any IPv4 address and «::» means any IPv6 address. | Required |
Examples
Following are four examples of the add iplisten command.
- add iplisten ipaddress=fe80::1
- add iplisten ipaddress=1.1.1.1
- add iplisten ipaddress=0.0.0.0
- add iplisten ipaddress=::
add sslcert
Adds a new SSL server certificate binding and corresponding client certificate policies for an IP address and port.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
ipport | Specifies the IP address and port for the binding. A colon character (:) is used as a delimiter between the IP address and the port number. | Required |
certhash | Specifies the SHA hash of the certificate. This hash is 20 bytes long and is specified as a hexadecimal string. | Required |
appid | Specifies the GUID to identify the owning application. | Required |
certstorename | Specifies the store name for the certificate. Defaults to MY. Certificate must be stored in the local machine context. | Optional |
verifyclientcertrevocation | Specifies the Turns on/off verification of revocation of client certificates. | Optional |
verifyrevocationwithcachedclientcertonly | Specifies whether the usage of only cached client certificate for revocation checking is enabled or disabled. | Optional |
usagecheck | Specifies whether the usage check is enabled or disabled. Default is enabled. | Optional |
revocationfreshnesstime | Specifies the time interval, in seconds, to check for an updated certificate revocation list (CRL). If this value is zero, then the new CRL is updated only if the previous one expires. | Optional |
urlretrievaltimeout | Specifies the timeout interval (in milliseconds) after the attempt to retrieve the certificate revocation list for the remote URL. | Optional |
sslctlidentifier | Specifies the list of the certificate issuers that can be trusted. This list can be a subset of the certificate issuers that are trusted by the computer. | Optional |
sslctlstorename | Specifies the certificate store name under LOCAL_MACHINE where SslCtlIdentifier is stored. | Optional |
dsmapperusage | Specifies whether DS mappers is enabled or disabled. Default is disabled. | Optional |
clientcertnegotiation | Specifies whether the negotiation of certificate is enabled or disabled. Default is disabled. | Optional |
Examples
Following is an example of the add sslcert command.
add sslcert ipport=1.1.1.1:443 certhash=0102030405060708090A0B0C0D0E0F1011121314 appid=
add timeout
Adds a global timeout to the service.
Syntax
Parameters
Parameter | Description |
---|---|
timeouttype | Type of timeout for setting. |
value | Value of the timeout (in seconds). If the value is in hexadecimal notation, then add the prefix 0x. |
Examples
Following are two examples of the add timeout command.
- add timeout timeouttype=idleconnectiontimeout value=120
- add timeout timeouttype=headerwaittimeout value=0x40
add urlacl
Adds a Uniform Resource Locator (URL) reservation entry. This command reserves the URL for non-administrator users and accounts. The DACL can be specified by using an NT account name with the listen and delegate parameters or by using an SDDL string.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
url | Specifies the fully qualified Uniform Resource Locator (URL). | Required |
user | Specifies the user or user-group name | Required |
listen | Specifies one of the following values: yes: Allow the user to register URLs. This is the default value. no: Deny the user from registering URLs. | Optional |
delegate | Specifies one of the following values: yes: Allow the user to delegate URLs no: Deny the user from delegating URLs. This is the default value. | Optional |
sddl | Specifies an SDDL string that describes the DACL. | Optional |
Examples
Following are four examples of the add urlacl command.
- add urlacl url=https://+:80/MyUri user=DOMAIN\user
- add urlacl url=https://www.contoso.com:80/MyUri user=DOMAIN\user listen=yes
- add urlacl url=https://www.contoso.com:80/MyUri user=DOMAIN\user delegate=no
- add urlacl url=https://+:80/MyUri sddl=.
delete cache
Deletes all the entries, or a specified entry, from the HTTP service kernel URI cache.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
url | Specifies the fully qualified Uniform Resource Locator (URL) that you want to delete. | Optional |
recursive | Specifies whether all entries under the url cache get removed. yes: remove all entries no: do not remove all entries | Optional |
Examples
Following are two examples of the delete cache command.
delete iplisten
Deletes an IP address from the IP listen list. The IP listen list is used to scope the list of addresses to which the HTTP service binds.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
ipaddress | The IPv4 or IPv6 address to be deleted from the IP listen list. The IP listen list is used to scope the list of addresses to which the HTTP service binds. «0.0.0.0» means any IPv4 address and «::» means any IPv6 address. This does not include the port number. | Required |
Examples
Following are four examples of the delete iplisten command.
- delete iplisten ipaddress=fe80::1
- delete iplisten ipaddress=1.1.1.1
- delete iplisten ipaddress=0.0.0.0
- delete iplisten ipaddress=::
delete sslcert
Deletes SSL server certificate bindings and corresponding client certificate policies for an IP address and port.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
ipport | Specifies the IPv4 or IPv6 address and port for which the SSL certificate bindings get deleted. A colon character (:) is used as a delimiter between the IP address and the port number. | Required |
Examples
Following are three examples of the delete sslcert command.
- delete sslcert ipport=1.1.1.1:443
- delete sslcert ipport=0.0.0.0:443
- delete sslcert ipport=[::]:443
delete timeout
Deletes a global timeout and makes the service revert to default values.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
timeouttype | Specifies the type of timeout setting. | Required |
Examples
Following are two examples of the delete timeout command.
- delete timeout timeouttype=idleconnectiontimeout
- delete timeout timeouttype=headerwaittimeout
delete urlacl
Deletes URL reservations.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
url | Specifies the fully qualified Uniform Resource Locator (URL) that you want to delete. | Required |
Examples
Following are two examples of the delete urlacl command.
flush logbuffer
Flushes the internal buffers for the logfiles.
Syntax
show cachestate
Lists cached URI resources and their associated properties. This command lists all resources and their associated properties that are cached in HTTP response cache or displays a single resource and its associated properties.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
url | Specifies the fully qualified URL that you want to display. If not specified, display all URLs. The URL could also be a prefix to registered URLs. | Optional |
Examples
Following are two examples of the show cachestate command:
show iplisten
Displays all IP addresses in the IP listen list. The IP listen list is used to scope the list of addresses to which the HTTP service binds. «0.0.0.0» means any IPv4 address and «::» means any IPv6 address.
Syntax
show servicestate
Displays a snapshot of the HTTP service.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
View | Specifies whether to view a snapshot of the HTTP service state based on the server session or on the request queues. | Optional |
Verbose | Specifies whether to display verbose information that also shows property information. | Optional |
Examples
Following are two examples of the show servicestate command.
- show servicestate view=»session»
- show servicestate view=»requestq»
show sslcert
Displays Secure Sockets Layer (SSL) server certificate bindings and corresponding client certificate policies for an IP address and port.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
ipport | Specifies the IPv4 or IPv6 address and port for which the SSL certificate bindings display. A colon character (:) is used as a delimiter between the IP address and the port number. If you do not specify ipport, all bindings are displayed. | Required |
Examples
Following are five examples of the show sslcert command.
- show sslcert ipport=[fe80::1]:443
- show sslcert ipport=1.1.1.1:443
- show sslcert ipport=0.0.0.0:443
- show sslcert ipport=[::]:443
- show sslcert
show timeout
Displays, in seconds, the timeout values of the HTTP service.
Syntax
show urlacl
Displays discretionary access control lists (DACLs) for the specified reserved URL or all reserved URLs.
Syntax
Parameters
Parameter | Description | Requirement |
---|---|---|
url | Specifies the fully qualified URL that you want to display. If not specfied, display all URLs. | Optional |
Examples
Following are three examples of the show urlacl command.