Professional Documents
Culture Documents
The Network Shell (Netsh) tool was first introduced with Windows 2000. It allows you
to configure, troubleshoot, and administer many different network components of
Windows via the command line both locally and remotely. More contexts and
commands have been added with Windows releases to support new and existing
network functions.
You can create and manage Wireless Hosted Networks with Netsh:
• netsh wlan set hostednetwork: Define the settings for the Wireless Hosted
Network, using the following optional parameters:
- mode = { allow | disallow }
- ssid = WirelessNetworkName
- key = YourDesiredPassword
- keyUsage = { persistent | temporary }
• netsh wlan refresh hostednetwork: Set a new WPA2-PSK encryption key.
Enter the command followed by the new key.
• netsh wlan start hostednetwork: Enable and start broadcasting the Wireless
Hosted Network.
• netsh wlan stop hostednetwork: Disable and stop broadcasting the Wireless
Hosted Network.
• netsh wlan show hostednetwork: Print the settings of the Wireless Hosted
Network, including a list of connected users.
• netsh wlan export hostednetworkprofile: Save the Wireless Hosted Network
profile as an XML file, using the following parameters:
- Folder = PathandFileName
- Name = WirelessProfileName (as shown when using the netsh wlan show
profiles command)
Figure 1: Setting up and starting a Wireless Hosted Network.
Here are some new WLAN commands to show or print the value of other settings:
Microsoft added a diagnostic tool for the WFP in Windows 7 and Windows Server 2008
R2. It can help you troubleshoot issues with Windows Firewall and IPsec. It runs
diagnostic tests and creates a report in XML format. Here are the diagnostic capture
commands:
• netsh wfp capture start: Begins the capturing, and continues until you enter the
stop command, with the following optional parameters:
- cab = { on | off }: Specify if the two output files should be compressed into
a .cab file. When not specified, it is set to on.
- traceonly = { on | off }: State if only event tracing data should be captured,
reducing the output file size. When not specified, it is set to off.
- keywords = { none | bcast | mcast | bcast+mcast }: Set the type of network
traffic to capture. Unicast network traffic is always included, even when set to
none. bcast means broadcast traffic and mcast is multicast traffic.
- file = PathAndFilename: Specify the path and filename (without extension) to
write the output files.
• netsh wfp capture status: Shows if a capture session is currently active.
• netsh wfp capture stop: Stops the capturing session.
• netsh trace show scenarios: Lists the network components you can perform
traces and diagnosis on.
• netsh trace show scenario: Shows the information for the specified scenario,
including the attribute(s) for the you can use to perform the diagnosis, using the
required parameter:
- name = ScenarioName: Specify the name of the desired scenario.
• netsh trace diagnose: Starts a diagnostic session that tries to detect the root
cause and repair the issue, using the following parameters:
- scenario = ScenarioName (Required)
- namedAttribute = AttributeValue (Required)
- saveSessionTrace = { yes | no }
- report = { yes | no }
- capture = { yes | no }
Figure 3: Running a FileSharing diagnosis to see why the LAPTOP computer isn’t
accessible.
• netsh trace start: Begins a trace session, using the following optional
parameters:
- scenario = Scenario1,Scenario2
- globalKeywords = keywords
- globalLevel = level
- capture = { yes | no }
- report = { yes | no }
- persistent = { yes | no }
- traceFile = Path\Filename
- maxSize = MaxFileSizeInMB
- fileMode = { single | circular | append }
- overwrite = { yes | no }
- correlation = { yes | no | disabled }
- provider = ProviderIdOrName
- keywords = KeywordMaskOrSet
- level = level
- provider = Provider2IdOrName
- keywords = Keyword2MaskOrSet
• netsh trace Stop: Stops the trace session.
Figure 4: Starting and stopping a trace on the WLAN.
The trace convert and trace correlate commands can help you manipulate the trace
files. Plus you might look into the following that can display more information related
to tracing and diagnosis: