Edit

Share via


Set-NetQosPolicy

Updates the QoS policy settings.

Syntax

Query (cdxml) (Default)

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

InputObject (cdxml)

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

Description

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).

Examples

Example 1: Update a QoS policy to apply to outgoing traffic from a domain-joined adapter

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

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

Example 2: Update the precedence of a policy

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

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

Example 3: Add additional matching conditions

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

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

Example 4: Update a QoS policy

PS C:\> Set-NetQosPolicy -Name "IIS" -Recursive $True -ThrottleRateActionBitsPerSecond 3000KB

This command 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. An alias for the ThrottleRateActionBitsPerSecond parameter is ThrottleRateAction. Another alias is MaxBw.

Parameters

-AppPathNameMatchCondition

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AppPathName, ApplicationName, app

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DSCPAction

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.

Parameter properties

Type:SByte
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DSCPValue, DSCP

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-InputObject

Specifies the input object that is used in a pipeline command.

Parameter properties

Type:

CimInstance[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

InputObject (cdxml)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-IPDstPortEndMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPDstPortEnd

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IPDstPortMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPDstPort, DestinationPort, dp, dstport, destport

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IPDstPortStartMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPDstPortStart

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IPDstPrefixMatchCondition

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPDstPrefix, DestinationAddress, da, dst, dstaddr, dstip, dest, destaddr, destip

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IPPortMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPPort, port

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IPProtocolMatchCondition

Specifies the IP protocol to be used to match the network traffic. The acceptable values for this parameter are: TCP, UDP, and Both. If this parameter is unspecified, then Both is the default value. The QoS policy will apply to both TCP and UDP traffic.

Parameter properties

Type:Protocol
Default value:None
Accepted values:None, TCP, UDP, Both
Supports wildcards:False
DontShow:False
Aliases:IPProtocol, Protocol

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IPSrcPortEndMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPSrcPortEnd

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IPSrcPortMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPSrcPort, SourcePort, sp, srcport

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IPSrcPortStartMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPSrcPortStart

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IPSrcPrefixMatchCondition

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:IPSrcPrefix, SourceAddress, sa, src, srcaddr, srcip

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MinBandwidthWeightAction

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. The acceptable values for this parameter are: 1 through 100.

Parameter properties

Type:Byte
Default value:None
Supports wildcards:False
DontShow:False
Aliases:MinBandwidthWeight, minbww, weight

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the QoS policy name.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Query (cdxml)
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-NetDirectPortMatchCondition

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.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False
Aliases:NetDirectPort, ndport, networkdirectport

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-NetworkProfile

Specifies the profile, or connection type, of a network. The acceptable values for this parameter are: 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.

Parameter properties

Type:NetworkProfile
Default value:None
Accepted values:Domain, Public, Private, All
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PolicyStore

Specifies the location of the policy that is stored. The acceptable values for this parameter are:

  • ActiveStore
  • COMPUTERNAME
  • GPO:COMPUTERNAME
  • GPO:DOMAIN\GPONAME
  • LDAP://LDAP-URL

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:store

Parameter sets

Query (cdxml)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Precedence

Specifies the priority of a QoS policy. A higher priority policy will override a lower priority policy in case the priorities are conflicting. The acceptable values for this parameter are: 0 through 255. 255 specifies the highest priority and 0 specifies the lowest. If not specified, then the default value is 127.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PriorityValue8021Action

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.

Parameter properties

Type:SByte
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PriorityValue, PriorityValue8021, pri, dot1p

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TemplateMatchCondition

Specifies a number of filters built in Windows Server® 2012. The acceptable values for this parameter are: FCoE, iSCSI, LiveMigration, NFS, SMB, or Cluster. For more information, see the New-NetQosPolicy cmdlet.

Parameter properties

Type:Template
Default value:None
Accepted values:None, Default, iSCSI, FCoE, SMB, NFS, LiveMigration, Cluster
Supports wildcards:False
DontShow:False
Aliases:Template

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ThrottleRateActionBitsPerSecond

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

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ThrottleRateAction, ThrottleRate, Throttle, maxbw

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-URIMatchCondition

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:URI, url

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-URIRecursiveMatchCondition

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.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False
Aliases:URIRecursive, urlrecursive, recursive

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-UserMatchCondition

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:User, sid

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

CimInstance

Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetQosPolicy.NetworkProfile

UInt32

Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetQosPolicy.Template

String

Microsoft.PowerShell.Cmdletization.GeneratedTypes.NetQosPolicy.Protocol

UInt16

Boolean

SByte

Byte

UInt64

Outputs

CimInstance

CimInstance

The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#) provides the namespace and class name for the underlying WMI object. The MSFT_NetQosPolicySettingData object contains a QoS policy. Only if the PassThru parameter is specified does this cmdlet return the MSFT_NetQosPolicySettingData object.