Using Netsh for viewing Wireless Networks

Hey Guys,

In the past I have had to investigate wireless channel information on corporate SOE computers that did not have any useful wireless tools such as inSSIDer or Netstumbler installed. After some research I found out you can use the inbuilt windows netsh command to display information about wireless networks that the client can see.

An example of the command in action follows:

C:\Users\bruce>netsh
netsh>wlan
netsh wlan>show /?

The following commands are available:

Commands inherited from the netsh context:
show alias     - Lists all defined aliases.
show helper    - Lists all the top-level helpers.
show mode      - Shows the current mode.

Commands in this context:
show all       - Shows complete wireless device and networks information.
show allowexplicitcreds - Shows the allow shared user credentials settings.
show autoconfig - Shows whether the auto configuration logic is enabled or
                 disabled.
show blockednetworks - Shows the blocked network display settings.
show createalluserprofile - Shows whether everyone is allowed to create all
                 user profiles.
show drivers   - Shows properties of the wireless LAN drivers on the system.
show filters   - Shows the allowed and blocked network list.
show hostednetwork - Show hosted network properties and status.
show interfaces - Shows a list of the wireless LAN interfaces on
                 the system.
show networks  - Shows a list of networks visible on the system.
show onlyUseGPProfilesforAllowedNetworks - Shows the only use GP profiles on GP
configured networks setting.
show profiles  - Shows a list of profiles configured on the system.
show settings  - Shows the global settings of wireless LAN.
show tracing   - Shows whether wireless LAN tracing is enabled or disabled.
netsh wlan>show networks /?

Usage: show networks [[interface=]] [[mode=]ssid/bssid]

Parameters:

    Tag             Value
    interface     - Name of the interface which has this profile configured.
    mode          - Get detailed bssid information.

Remarks:

    Shows the networks available to the system.
    Parameter interface and bssid are both optional.

    If interface name is given, only the networks on the given
    interface will be listed. Otherwise, all networks visible to
    the system will be listed.

    If mode=bssid is given then the visible bssids for each ssid
    will also be listed. Otherwise only ssids will be listed.

Examples:

    show networks interface="Wireless Network Connection"
    show networks mode=Bssid
    show networks

netsh wlan>sh networks

Interface name : Wireless Network Connection
There are 3 networks currently visible.

SSID 1 : -SSID #1-
    Network type            : Adhoc
    Authentication          : Open
    Encryption              : None

SSID 2 : -SSID #2-
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP

SSID 3 : -SSID #3-
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP

netsh wlan>sh networks mode=bssid

Interface name : Wireless Network Connection
There are 3 networks currently visible.

SSID 1 : -SSID #1-
    Network type            : Adhoc
    Authentication          : Open
    Encryption              : None
    BSSID 1                 : xx:xx:xx:xx:xx:xx
         Signal             : 100%
         Radio type         : 802.11b
         Channel            : 1
         Basic rates (Mbps) :
         Other rates (Mbps) : 11

SSID 2 : -SSID #2-
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP
    BSSID 1                 : xx:xx:xx:xx:xx:xx
         Signal             : 100%
         Radio type         : 802.11g
         Channel            : 6
         Basic rates (Mbps) : 1 2 5.5 6 11 12 24
         Other rates (Mbps) : 9 18 36 48 54

SSID 3 : -SSID #3-
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP
    BSSID 1                 : xx:xx:xx:xx:xx:xx
         Signal             : 100%
         Radio type         : 802.11n
         Channel            : 6
         Basic rates (Mbps) : 1 2 5.5 11
         Other rates (Mbps) : 6 9 12 18 24 36 48 54

netsh wlan>

The best thing about this command output it gives you the Received Signal Strength as a percentage and it gives you the channel number in use! Very useful for when trying to find some clean air on your network!

This entry was posted in Windows, Wireless by Bruce Large. Bookmark the permalink.

About Bruce Large

Follow me on Twitter @belarge - http://twitter.com/belarge

5 thoughts on “Using Netsh for viewing Wireless Networks

  1. This batch file works, but the adapter name has to be hard coded, is there a way to put the name into a variable from netsh so that the code can be generic?

    @echo off
    echo Please wait … Enabling adapter …

    netsh interface show interface name=”Wi-Fi” | find /i “DISCONNECTED” >nul && netsh interface set interface “Wi-Fi” ENABLE”
    netsh interface show interface name=”Ethernet” | find /i “DISCONNECTED” >nul && netsh interface set interface “Ethernet” ENABLE”

    echo Process completed
    timeout /t 10

    thanks….

  2. How to refresh the list of user profiles?
    netsh wlan show profile
    the above displayed only historic profiles not the discovered ones.
    how to update it.

  3. Hi,

    Could you please let me know if we have an option to connect to required SSID using BSSID MAC address from windows command line?
    I see that we have below option in windows 7:
    netsh wlan connect ssid
    Do we have an option to specify the bssid mac as well in the above command?

Leave a Reply

Your email address will not be published. Required fields are marked *