Netsh Commands for Wired Local Area Network (LAN) in Windows Server 2008 and Windows Server 2008 R2
Updated: June 11, 2009
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
The Netsh commands for wired local area network (LAN) provide methods to configure connectivity and security settings for computers running Windows Server® 2008 R2, Windows® 7, Windows Server® 2008, and Windows Vista®. You can use the Netsh LAN commands to configure the local computer or to configure multiple computers by using a logon script. You can also use the Netsh LAN commands to view wired 802.1X Group Policy and to administer user wired 802.1X settings.
Wired Network (IEEE 802.3) Policies profiles are read-only, and cannot be modified or deleted by using Netsh LAN commands.
Following are the Netsh LAN commands that you can run on computers running Windows Server® 2008 R2, Windows® 7, Windows Server® 2008, and Windows Vista®.
add profile
delete profile
export profile
reconnect
set allowexplicitcreds
set autoconfig
set profileparameter
set tracing
show interfaces
show profiles
show settings
show tracing
The following command is new in Windows Server 2008 R2, and Windows 7, and cannot be run against computers running Windows Server 2008, Windows Vista, or earlier releases of the Windows operating system.
- set blockperiod
The following entries provide details for each command.
Adds a LAN profile to the specified interface on the computer.
**add profile filename=**PathAndProfileName [[interface=]InterfaceName]
- filename
Required. Specifies the path and name of the XML file containing the profile data.
- interface
Optional. Specifies the name of the interface on which the profile will be set (where InterfaceName is the name of the interface as displayed in Network Connections or as rendered by the Netsh lan show interfaces command).
The interface parameter specifies one of the interface names shown by the Netsh lan show interface command. If the interface is specified, the profile is added to the specified interface. There is wildcard support for this parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively.
- add profile filename=C:\Users\WiredUser\Documents\profile1.xml interface="Local Area Connection"
Removes a LAN profile from one or multiple interfaces.
**delete profile interface=**InterfaceName
interface
- Required. Specifies the name of the interface on which one or more profiles are to be deleted (where InterfaceName is the name of the interface as displayed in Network Connections, or as rendered by the Netsh lan show interfaces command).
There is wildcard support for the interface parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively.
delete profile interface="Local Area Connection"
delete profile interface=L*
Saves LAN profiles as XML files to a specified location.
**export profile folder=**PathAndFileName [[interface=]InterfaceName]
folder
- Required. Specifies the path and file name for the profile XML file.
- interface
Optional. Specifies the name of the interface on which the profile is configured (where InterfaceName is the name of the interface as displayed in Network Connections, or as rendered by the Netsh lan show interfaces command).
The folder parameter must specify an existing folder that is accessible from the local computer. It can be either an absolute path or relative path to the current working directory. In addition, "." refers to the current working directory, and ".." refers to the parent directory of the current working directory. The folder name cannot be a Universal Naming Convention (UNC) path.
If the interface parameter is specified, only the specified profile associated with that interface is saved. Otherwise, all profiles on the computer with the specified name are saved.
Profiles of specified interfaces are saved in the format "InterfaceName ProfileName.xml." Profiles at the computer level are saved in the file name format "ProfileName.xml."
There is wildcard support for this parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively.
export profile folder=c:\Users\user\Documents\ interface="Local Area Connection"
export profile folder=c:\Users\user\Documents\
Attempts to reauthenticate to a wired network by using the specified interface.
reconnect [[interface=]InterfaceName]
- interface
Optional. Specifies the interface that is used for the connection attempt (where InterfaceName is the name of the interface as displayed in Network Connections, or as rendered by the Netsh lan show interfaces command).
If the interface parameter is specified, only the specified interface is used for the connection attempt. If the interface parameter is not specified, all interfaces attempt to reconnect. Wildcard (*) names cannot be used to specify the interface name.
- reconnect interface="Local Area Connection"
Specifies whether to allow or disallow client computers to store and use shared user credentials for network authentication.
set allowexplicitcreds allow={yes|no}
- allow
Required. The options for parameter allow are “yes” or “no.”
This Netsh command is new in Windows Server 2008 R2 and cannot be run on computers running Windows Server 2008.
- set allowexplicitcreds allow=yes
Enables or disables Wired AutoConfig Service on an interface.
set autoconfig enabled={yes|no} **interface=**InterfaceName
- enabled
Required. Specifies whether to set Wired AutoConfig Service to enabled or disabled.
- interface
Required. Specifies the name of the interface on which the service is enabled or disabled (where InterfaceName is the name of the interface as displayed in Network Connections, or as rendered by the Netsh lan show interfaces command).
When Wired AutoConfig is enabled, computers running Windows Vista and Windows Server 2008 automatically connect to the network by using the specified interface. By default, Wired AutoConfig is enabled.
If Wired AutoConfig is disabled, Windows will not automatically connect to any networks by using the specified interface.
There is wildcard support for the interface parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively.
- set autoconfig enabled=yes interface="Local Area Connection"
Specifies in minutes, the amount of time during which auto connect attempts to this network are suspended.
set blockperiod [value=]numeric value in the range of 0 - 60
- value
The parameter value tag is optional, however, a numeric value in the range of 0 – 60 is required; see example commands below.
This Netsh command is new in Windows Server 2008 R2 and cannot be run on computers running Windows Server 2008.
Modifies the blockperiod timer. The blocked state is reset upon a manual connection attempt, a session change or a media connect.
set blockperiod value=2
set blockperiod 25
Sets parameters in a wired network profile.
Note
The set profileparameter is only available on computers running Windows Vista with Service Pack 1, and Windows Server 2008, and subsequent releases of the Windows operating system.
**set profileparameter name=**ProfileName [[interface=]InterfaceName] [[authMode=]{machineOrUser|machineOnly|userOnly|guest}] [[ssoMode=]{preLogon|postLogon|none}] [[maxDelay=]1-120] [[allowDialog={yes|no}] [[userVLAN=]{yes|no}][oneXEnabled={yes|no}] [oneXEnforced=yes|no]
- Name
Required. Specifies the name of the profile to set (where ProfileName is the name of the profile, as rendered by the Netsh lan show profile command).
- interface
Optional. Specifies the name of the interface on which the profile is set (where InterfaceName is the name of the interface as displayed in Network Connections, or as rendered by the Netsh lan show interfaces command).
- authMode
Optional [conditional, see "Remarks"]. Specifies the type of credentials to be used for authentication.
- SSOMode
Optional [conditional, see "Remarks"].Specifies the type of single sign on (SSO) to be attempted if any.
- MaxDelay
Optional [conditional, see "Remarks"]. Specifies the timeout value allowed to establish the single sign-on connection.
- AllowDialog
Optional [conditional, see "Remarks"].Specifies whether to allow or disallow a dialog to be shown for preLogon.
userVLAN
- Optional [conditional, see "Remarks"]. Specifies if the network switches to a different VLAN upon user authentication.
- oneXEnabled
Optional [conditional, see "Remarks"]. Specifies whether OneX authentication is enabled.
- oneXEnforced
Optional [conditional, see "Remarks"]. Specifies whether OneX authentication is enforced.
On computers running Windows Server 2008 R2 and Windows Server 2008, you must first start the Wired AutoConfig Service (dot3svc), in order to run the “Netsh LAN set profileparameter” command.
Parameter name is required; all other parameters are optional, however, regardless of whether parameter interface is specified, at least one other parameter must be specified.
If the parameter interface is specified then only profiles associated with that interface are modified.
set profileparameter name="Profile 1" authMode=userOnly ssoMode=preLogon
set profileparameter name=Profile2 interface="Local Area Connection" ssoMode=none
Enables or disables wired tracing.
set tracing [[mode=]{yes|no|persistent}]
- mode
Required. Specifies whether wired tracing is disabled, enabled and persistent, or enabled and nonpersistent. See "Remarks" for additional information.
If the mode parameter is set to yes, nonpersistent tracing is active until the mode is either set to no or the computer is restarted.
If the mode parameter is set to no, tracing is stopped for either persistent or nonpersistent tracing.
If the mode parameter is set to persistent, tracing is active even after the computer is restarted.
The default value for the mode parameter is nonpersistent.
- set tracing mode=persistent
Displays a list of the current wired interfaces on the computer.
show interfaces
There are no parameters for this command.
Shows the wired interfaces configured on the computer.
Displayed information includes:
The number of interfaces on the computer
Interface name
Description
GUID
Ethernet adapter physical address (MAC address).
State [network authentication support (yes or no)]
- show interfaces
Displays a list of wired profiles that are configured on the computer.
show profiles [[interface=]InterfaceName]
- Interface
Optional. Specifies the name of the interface which has this profile configured (where InterfaceName is the name of the interface as displayed in Network Connections, or as rendered by the Netsh lan show interfaces command). See "Remarks."
If the interface parameter is specified, then only the contents of the wired profile for the specified interface are displayed. Otherwise all profiles will be displayed with their name and description.
show profiles interface="Local Area Connection"
show profiles
Displays the current global settings of the wired LAN
show settings
There are no parameters for this command.
Shows the global settings for wired network service, including whether or not auto-configuration logic (Wired AutoConfig) is enabled on each interface.
- show settings
Displays whether wired tracing is enabled or disabled.
show tracing
There are no parameters for this command.
Displayed information includes:
Wired tracing state (started or stopped)
Wired tracing persistence state (enabled or disabled)
Trace log file location (for example, "c:\Windows\system32\logfiles\WiredAutoLog\"
- show tracing