Export (0) Print
Expand All

Network Policy Commands

Updated: October 22, 2013

Applies To: Windows Server 2008

This section contains the following commands:

For information on how to interpret netsh command syntax, see Formatting Legend.

The following entries provide details for each command.

Adds a network policy to the Network Policy Server (NPS) configuration.

add np [ name = ] name [ [ state = ] Enable | Disable [ processingorder = ] processingorder [ policysource = ] policysource [ conditionid = ] conditionid [ conditiondata = ] conditiondata [ profileid = ] profileid ([ advprofiletype = ] type [ advprofiledata = ] data ) [ profiledata = ] profiledata ]

name
Required. Specifies the name of the network policy that you want to add.

state
Optional. Specifies whether the network policy is enabled or disabled. The default is enabled.

processingorder
Optional. Specifies the numeric position of this policy in the list of policies configured in NPS. Policies highest in the list (for example, at first position) are processed by NPS first. Policies added at positions above other policies cause the positions of the other policies to drop in the list by one position. If processingorder is not specified, the policy is added at the end of the list.

policysource
Optional. Specifies the type of RADIUS client that can send connection requests that match this policy. An integer value of zero through five must be used to designate the type of RADIUS client that is allowed for the policy. The default value of zero allows connection requests from any type of RADIUS client. See the Remarks section for all valid values.

conditionid
Required. Specifies the condition attribute name or ID that you want to configure in this network policy.

You can view the list of available condition attributes at the netsh prompt by running the show npconditionattributes command. See the section "NPS attributes" for more information.

profileid
Optional. Specifies an attribute that you want to add to the network policy. Use profiledata to specify the value of the attribute defined by profileid. In addition, each profileid that you specify can be followed by multiple pairs of parameters named advprofiletype and advprofiledata. The syntax for these parameters is:

[advprofiletype= ] type [advprofiledata=] data

You can view the list of available settings attributes at the netsh prompt by running the show npprofileattributes command.

See the Remarks section and "NPS attributes" for more information.

advprofiletype
Optional. Specifies an attribute that you want to add to the network policy. This parameter is a sub-parameter of and must be preceded by the profileid parameter. Use advprofiledata to add values for the attribute defined with advprofiletype.

advprofiledata
Optional. Specifies the value of the attribute defined with advprofiletype. This parameter is a sub-parameter of and must be preceded by the profileid parameter. In addition, you must specify advprofiletype when you use advprofiledata.

profiledata
Optional. Specifies the value of the attribute defined with profileid. For example, if the attribute specified in profileid is NP-Authentication-Type (0x1009), the value of profiledata might be 0x3 (MS-CHAP v1) or 0x4 (MS-CHAP v2). In cases where multiple values are allowed for an attribute, they can be listed:

profileid = "0x1009" profiledata = "0x3" profiledata = "0x4" profiledata = "0x9" profiledata = "0xa"

Network policy is configured by default with the following authentication method settings:

  • Microsoft Encrypted Authentication version 2 (MS-CHAP v2, profiledata=0x4) and User can change password after it has expired (profiledata=0xa)

  • Microsoft Encrypted Authentication (MS-CHAP, profiledata=0x3) and User can change password after it has expired (profiledata=0x9)

In the NPS console, these authentication settings are located on the Settings tab of network policies under Constraints and Authentication Methods.

For policysource, valid values are:

 

ID Policy Source

0

Unspecified (default)

1

Terminal Services Gateway

2

Remote Access Server (VPN or Dial-up)

3

DHCP server

4

Wireless Access Point

5

Health Registration Authority

You can use the profileid, advprofiletype, and advprofiledata parameters to configure IP filters for the network policy that you add. For more information, see the section "Configuring IP filters with Netsh NPS commands."

Deletes the specified network policy.

delete np [ name = ] name

name
Required. Specifies the name of the network policy that you want to delete.

The following examples delete a network policy named NP1 from the NPS server configuration.

delete np name = NP1

delete np NP1

Changes the name of a network policy.

rename np [ name = ] name [ newname = ] newname

name
Required. Specifies the network policy that you want to rename.

newname
Required. Specifies the new name for the network policy.

The following examples rename a network policy from NP1 to NP2. The examples demonstrate that the command can be run with the parameter tags, such as name=, and without them.

rename np name = NP1 newname = NP2

rename np NP1 NP2

Deletes all network policies that are configured in NPS and restores the default network policy.

CautionCaution
Do not run this command if you want to maintain any of the network policies that you have configured at the NPS server. This command deletes all network policies that you have configured, and after running this command, your network policies cannot be recovered. Before you run this command, it is recommended that you use the export command to save the NPS server configuration to an XML file.

reset np

Changes the value of one or more properties of an existing network policy. Values specified by this command overwrite the existing values.

set np [ name = ] name [ [ state = ] Enable | Disable [ processingorder = ] processingorder [ policysource = ] policysource [ conditionid = ] conditionid [ conditiondata = ] conditiondata [ profileid = ] profileid ([ advprofiletype = ] type [ advprofiledata = ] data ) [ profiledata = ] profiledata ]

name
Required. Specifies the name of the network policy that you want to add.

state
Optional. Specifies whether the network policy is enabled or disabled. The default is enabled.

processingorder
Optional. Specifies the numeric position of this policy in the list of policies configured in NPS. Policies highest in the list (for example, at first position) are processed by NPS first. Policies added at positions above other policies cause the positions of the other policies to drop in the list by one position. If processingorder is not specified, the policy is added at the end of the list.

policysource
Optional. Specifies the type of RADIUS client that can send connection requests that match this policy. An integer value of zero through five must be used to designate the type of RADIUS client that is allowed for the policy. The default value of zero allows connection requests from any type of RADIUS client. See the Remarks section for all valid values.

conditionid
Required. Specifies the condition attribute name or ID that you want to configure in this network policy.

You can view the list of available condition attributes at the netsh prompt by running the show npconditionattributes command. See the section "NPS attributes" for more information.

profileid
Optional. Specifies an attribute that you want to add to the network policy. Use profiledata to specify the value of the attribute defined by profileid. In addition, each profileid that you specify can be followed by multiple pairs of parameters named advprofiletype and advprofiledata. The syntax for these parameters is:

[advprofiletype= ] type [advprofiledata=] data

You can view the list of available settings attributes at the netsh prompt by running the show npprofileattributes command.

See the Remarks section and "NPS attributes" for more information.

advprofiletype
Optional. Specifies an attribute that you want to add to the network policy. This parameter is a sub-parameter of and must be preceded by the profileid parameter. Use advprofiledata to add values for the attribute defined with advprofiletype.

advprofiledata
Optional. Specifies the value of the attribute defined with advprofiletype. This parameter is a sub-parameter of and must be preceded by the profileid parameter. In addition, you must specify advprofiletype when you use advprofiledata.

profiledata
Optional. Specifies the value of the attribute defined with profileid. For example, if the attribute specified in profileid is NP-Authentication-Type (0x1009), the value of profiledata might be 0x3 (MS-CHAP v1) or 0x4 (MS-CHAP v2). In cases where multiple values are allowed for an attribute, they can be listed:

profileid = "0x1009" profiledata = "0x3" profiledata = "0x4" profiledata = "0x9" profiledata = "0xa"

Network policy is configured by default with the following authentication method settings:

  • Microsoft Encrypted Authentication version 2 (MS-CHAP v2, profiledata=0x4) and User can change password after it has expired (profiledata=0xa)

  • Microsoft Encrypted Authentication (MS-CHAP, profiledata=0x3) and User can change password after it has expired (profiledata=0x9)

In the NPS console, these authentication settings are located on the Settings tab of network policies under Constraints and Authentication Methods.

For policysource, valid values are:

 

ID Policy Source

0

Unspecified (default).

1

Terminal Services Gateway.

2

Remote Access Server (VPN or Dial up).

3

DHCP server.

4

Wireless Access Point.

5

Health Registration Authority.

You can use the profileid, advprofiletype, and advprofiledata parameters to configure IP filters for the network policy that you want to modify. For more information, see the section "Configuring IP filters with Netsh NPS commands."

Displays the full configuration of a network policy, including all of the conditions, settings, and attributes configured in the policy.

show np

Displays the list of attributes that you can add to the conditions of a network policy.

show npconditionattributes

Displays the list of attributes that you can add to the settings of a network policy.

show npprofileattributes

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft