Set-NetQosPolicy

Set-NetQosPolicy

Updates the Quality of Service (QoS) policy settings.

Sintaxis

Parameter Set: Query (cdxml)
Set-NetQosPolicy [[-Name] <String[]> ] [-AppPathNameMatchCondition <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-DSCPAction <SByte> ] [-IPDstPortEndMatchCondition <UInt16> ] [-IPDstPortMatchCondition <UInt16> ] [-IPDstPortStartMatchCondition <UInt16> ] [-IPDstPrefixMatchCondition <String> ] [-IPPortMatchCondition <UInt16> ] [-IPProtocolMatchCondition <Protocol> ] [-IPSrcPortEndMatchCondition <UInt16> ] [-IPSrcPortMatchCondition <UInt16> ] [-IPSrcPortStartMatchCondition <UInt16> ] [-IPSrcPrefixMatchCondition <String> ] [-MinBandwidthWeightAction <Byte> ] [-NetDirectPortMatchCondition <UInt16> ] [-NetworkProfile <NetworkProfile> ] [-PassThru] [-PolicyStore <String> ] [-Precedence <UInt32> ] [-PriorityValue8021Action <SByte> ] [-TemplateMatchCondition <Template> ] [-ThrottleLimit <Int32> ] [-ThrottleRateActionBitsPerSecond <UInt64> ] [-URIMatchCondition <String> ] [-URIRecursiveMatchCondition <Boolean> ] [-UserMatchCondition <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: InputObject (cdxml)
Set-NetQosPolicy -InputObject <CimInstance[]> [-AppPathNameMatchCondition <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-DSCPAction <SByte> ] [-IPDstPortEndMatchCondition <UInt16> ] [-IPDstPortMatchCondition <UInt16> ] [-IPDstPortStartMatchCondition <UInt16> ] [-IPDstPrefixMatchCondition <String> ] [-IPPortMatchCondition <UInt16> ] [-IPProtocolMatchCondition <Protocol> ] [-IPSrcPortEndMatchCondition <UInt16> ] [-IPSrcPortMatchCondition <UInt16> ] [-IPSrcPortStartMatchCondition <UInt16> ] [-IPSrcPrefixMatchCondition <String> ] [-MinBandwidthWeightAction <Byte> ] [-NetDirectPortMatchCondition <UInt16> ] [-NetworkProfile <NetworkProfile> ] [-PassThru] [-Precedence <UInt32> ] [-PriorityValue8021Action <SByte> ] [-TemplateMatchCondition <Template> ] [-ThrottleLimit <Int32> ] [-ThrottleRateActionBitsPerSecond <UInt64> ] [-URIMatchCondition <String> ] [-URIRecursiveMatchCondition <Boolean> ] [-UserMatchCondition <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

The Set-NetQosPolicy cmdlet modifies an existing Quality of Service (QoS) policy. Match conditions or actions or general parameters of the policy such as NetworkProfile or Precedence can be changed.

Users cannot change the location of where an existing QoS policy is stored. Changing the PolicyStore parameter value will fail.

If a policy was created to be in ActiveStore and a user attempts to make it persistent, such as storing the policy on the local computer, the user has to create a new policy and place it on the local computer (localhost).

If the PolicyStore parameter is not specified, then the cmdlet will search for and update the policy on the local computer (localhost).

Parámetros

-AppPathNameMatchCondition<String>

Specifies the name by which an application is run in Windows Server® 2012, such as application.exe or %ProgramFiles%\application.exeapplication.

Alias

AppPathName,ApplicationName,app

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-AsJob

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CimSession<CimSession[]>

Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.

Alias

Session

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-DSCPAction<SByte>

Specifies the differentiated services code point (DSCP) value. A valid DSCP value is in the range between 0 and 63. In addition, users can enter -1 to remove the DSCP setting from the policy.

Alias

DSCPValue,DSCP

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-InputObject<CimInstance[]>

Specified the object which will be modified by this cmdlet. The object must be piped to the cmdlet.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByValue)

¿Aceptar caracteres comodín?

false

-IPDstPortEndMatchCondition<UInt16>

Specifies the last port in a range of destination ports to be used to match the network traffic. This parameter must be used in conjunction with the IPDstPortStartMatchCondition parameter. The value of this parameter also must be larger than the value of the IPDstPortStartMatchCondition parameter.

Alias

IPDstPortEnd

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-IPDstPortMatchCondition<UInt16>

Specifies the exact destination port to be used to match the network traffic. The filter of a QoS policy can be based on either a single port or a range of ports. To specify a single destination port, use this parameter. To specify a range of destination ports, use both the IPDstPortStartMatchCondition and the IPDstPortEndMatchCondition parameters.

Alias

IPDstPort,DestinationPort,dp,dstport,destport

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-IPDstPortStartMatchCondition<UInt16>

Specifies the first port in a range of destination ports to be used to match the network traffic. This parameter must be used in conjunction with the IPDstPortEndMatchCondition parameter. The value of this parameter also must be smaller than the value of the IPDstPortEndMatchCondition parameter.

Alias

IPDstPortStart

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-IPDstPrefixMatchCondition<String>

Specifies the destination IP address, optionally with a network prefix, such as 1.2.3.4, 3ffe:ffff::1, 192.168.1.0/24, or fe80::1234/48.

Alias

IPDstPrefix,DestinationAddress,da,dst,dstaddr,dstip,dest,destaddr,destip

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-IPPortMatchCondition<UInt16>

Specifies the port to be used to match the network traffic, it can be either source port or destination port. If either the source port or the destination port in a packet matches the value of this parameter, then the QoS policy will apply to the packet. Usually this is a well-known port that a client uses to communicate with a server. With this parameter specified, the same QoS policy can be configured on both the clients and the servers and apply to the traffic in both directions. For example, specifying this parameter value to 80 matches HTTP traffic sent by both HTTP clients and HTTP servers.

Alias

IPPort,port

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-IPProtocolMatchCondition<Protocol>

Specifies the IP protocol to be used to match the network traffic. Los valores aceptables para este parámetro son los siguientes: TCP, UDP, or Both. If this parameter is unspecified, then Both is the default value. The QoS policy will apply to both TCP and UDP traffic.

Alias

IPProtocol,Protocol

¿Requerido?

false

¿Posición?

named

Valor predeterminado

Both

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-IPSrcPortEndMatchCondition<UInt16>

Specifies the last port in a range of source ports to be used to match the network traffic. This parameter must be used in conjunction with the IPSrcPortStartMatchCondition parameter. The value of this parameter also must be larger than the value of the IPSrcPortStartMatchCondition parameter.

Alias

IPSrcPortEnd

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-IPSrcPortMatchCondition<UInt16>

Specifies the exact source port to be used to match the network traffic. The filter of a QoS policy can be based on either a single port or a range of ports. To specify a single source port, use this parameter. To specify a range of source ports, use both the IPSrcPortStartMatchCondition and the IPSrcPortEndMatchCondition parameters.

Alias

IPSrcPort,SourcePort,sp,srcport

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-IPSrcPortStartMatchCondition<UInt16>

Specifies the first port in a range of source ports to be used to match the network traffic. This parameter must be used in conjunction with the IPSrcPortEndMatchCondition parameter. The value of this parameter also must be smaller than the value of the IPSrcPortEndMatchCondition parameter.

Alias

IPSrcPortStart

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-IPSrcPrefixMatchCondition<String>

Specifies the source IP address, optionally with a network prefix, such as 1.2.3.4, 3ffe:ffff::1, 192.168.1.0/24, or fe80::1234/48.

Alias

IPSrcPrefix,SourceAddress,sa,src,srcaddr,srcip

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-MinBandwidthWeightAction<Byte>

Specifies a numerical value for minimum bandwidth that a flow should get relatively. The actual bandwidth a flow gets will depend on the weights assigned to other flows in the computer. Los valores aceptables para este parámetro son los siguientes: 1 through 100.

Alias

MinBandwidthWeight,minbww,weight

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Name<String[]>

Specifies the QoS policy name.

Alias

ninguno

¿Requerido?

false

¿Posición?

1

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-NetDirectPortMatchCondition<UInt16>

Specifies the network direct port to be used to match the network traffic. Network Direct uses an independent port space from the TCP or UDP port space. Windows Server 2012 will send a Network Direct policy to a network adapter only if the network adapter supports Network Direct.

Alias

NetDirectPort,ndport,networkdirectport

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-NetworkProfile<NetworkProfile>

Specifies the profile, or connection type, of a network. Los valores aceptables para este parámetro son los siguientes: Domain, Public, Private, or All. If this parameter is not specified, then the QoS policy will be effective when a computer is connected on any type of connection.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

All

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-PassThru

Devuelve un objeto que representa el elemento con el que está trabajando. De forma predeterminada, este cmdlet no genera ningún resultado.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-PolicyStore<String>

Specifies the location of the policy that is stored. Los valores aceptables para este parámetro son los siguientes:
- ActiveStore
- COMPUTERNAME
- GPO:COMPUTERNAME
- GPO:DOMAIN\GPONAME
- LDAP://LDAP-URL

Alias

store

¿Requerido?

false

¿Posición?

named

Valor predeterminado

localhost

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Precedence<UInt32>

Specifies the priority of a QoS policy. A higher priority policy will override a lower priority policy in case the priorities are conflicting. Los valores aceptables para este parámetro son los siguientes: 0 through 255. 255 specifies the highest priority and 0 specifies the lowest. If not specified, then the default value is 127.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-PriorityValue8021Action<SByte>

Specifies the IEEE 802.1p value. A valid 802.1p value is in the range between 0 and 7. In addition, users can enter -1 to remove the 802.1p priority setting from the policy.

Alias

PriorityValue,PriorityValue8021,pri,dot1p

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-TemplateMatchCondition<Template>

Specifies a number of filters built in Windows Server® 2012. Los valores aceptables para este parámetro son los siguientes: FCoE, iSCSI, LiveMigration, NFS, SMB, or. Note: Refer to the corresponding parameter descriptions for the New-NetQosPolicy cmdlet.

Alias

Template

¿Requerido?

false

¿Posición?

named

Valor predeterminado

0

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ThrottleLimit<Int32>

Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-ThrottleRateActionBitsPerSecond<UInt64>

Specifies a throttle rate in bits per second to set the maximum bandwidth that can be consumed.

Alias

ThrottleRateAction,ThrottleRate,Throttle,maxbw

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-URIMatchCondition<String>

Specifies the URI to match. Only a HTTP URL is currently supported, such as http://myhost, https://*/training, http://myhost:8080/training, or https://myhost:*/training. The QoS policy will only apply to the traffic sent from HTTP server applications to HTTP clients in response to the requests from the client for the specified URI.

Alias

URI,url

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-URIRecursiveMatchCondition<Boolean>

Specifies that all subdirectories and files following the URI specified in the URIMatchCondition parameter are to be included. This parameter can be specified only if the URIMatchCondition parameter is specified.

Alias

URIRecursive,urlrecursive,recursive

¿Requerido?

false

¿Posición?

named

Valor predeterminado

$false

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-UserMatchCondition<String>

Specifies the user or group name in Active Directory, such as contoso\johnj99. This parameter is usually specified with other filtering parameter such as the AppPathNameMatchCondtion parameter.

Alias

User,sid

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Confirm

Solicita confirmación antes de ejecutar el cmdlet.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-WhatIf

Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetQosPolicySettingData

    El objeto Microsoft.Management.Infrastructure.CimInstance es una clase contenedora que muestra objetos de Instrumental de administración de Windows (WMI). La ruta de acceso después del signo de número (#) proporciona el espacio de nombres y el nombre de clase del objeto WMI subyacente.
    The MSFT_NetQosPolicySettingData object contains a QoS policy.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetQosPolicySettingData

    El objeto Microsoft.Management.Infrastructure.CimInstance es una clase contenedora que muestra objetos de Instrumental de administración de Windows (WMI). La ruta de acceso después del signo de número (#) proporciona el espacio de nombres y el nombre de clase del objeto WMI subyacente.
    The MSFT_NetQosPolicySettingData object contains a QoS policy. Only when the PassThru parameter is specified will this cmdlet return the MSFT_NetQosPolicySettingData object.

Ejemplos

EXAMPLE 1

This example updates the QoS policy named SMB Policy so that it only applies to traffic that is outgoing from a domain-joined network adapter.

PS C:\> Set-NetQosPolicy –Name "SMB Policy" -NetworkProfile Domain

EXAMPLE 2

This example gets the QoS policy named wildcard and updates the precedence of the policy to 250.

PS C:\> Get-NetQosPolicy –Name "wildcard" | Set-NetQosPolicy -Precedence 250

EXAMPLE 3

This example updates the QoS policy named Backup with additional matching conditions.

PS C:\> Set-NetQosPolicy –Name "Backup" -IPDstPortStart 3501 -IPDstPortEnd 3510

EXAMPLE 4

This example updates the QoS policy named IIS, so that it applies to the return traffic for both the specified URI and subdirectories and files under the URI. This cmdlet also sets a new throttling rate at 3,000,000 bytes per second. Note: An alias for the ThrottleRateActionBytesPerSecond parameter is ThrottleRateAction. Another alias is MaxBw.

PS C:\> Set-NetQosPolicy –Name "IIS" -Recursive $true -ThrottleRateActionBytesPerSecond 3000KB

Temas relacionados

Get-NetQosPolicy

New-NetQosPolicy

Remove-NetQosPolicy