How To: Manage Wireless Connections With Netsh Command Line Utility In Windows Vista

The Netsh command line utility has been available for the former Microsoft Windows operating systems like Windows 2000, Server 2003, and Windows XP.The Windows Netsh command line utility offers powerful tools to configure, manage, and troubleshoot certain networking components. For Windows Server 2008 and Windows Vista, Microsoft made a few improvements in Netsh command line utility, which include the addition of specific WLAN commands. Now Netsh provides the management of wireless adapters, profiles, and connectivity.

Exporting a wireless network profile can save time when setting up new computers, especially if the wireless network requires authentication and encryption settings. Instead of clicking through windows and dialogs, inputting all the settings manually, a wireless profile could be loaded from a flash or network drive onto the new Windows Vista computer with one line at the Command Prompt.

Creating filters with Windows Vista Netsh command line utility to Block Connections to Unsecured Ad Hoc Wireless Networks is also very useful; for example, to prevent users from connecting to neighboring open networks. Additionally, blocked networks can even be hidden from the list of networks the user sees.

Working with the wireless profiles in Windows Vista using
Netsh command line utility

When working with the wireless profiles, a good first step is to review the list of profiles, by entering the following command:

netsh wlan show profiles

That just shows the profile names, which is enough for importing and exporting. However, to display the settings of each profile, enter the following:

netsh wlan show all

To export a profile, use the following syntax:

netsh wlan export profile folder=PATH TO FOLDER name=PROFILENAME

It will create an XML file in the designated folder named with the interface and profile name, for example Wireless Network Connection-office_net.xml.

To import a profile, use the following syntax from the directory in which the profile is stored:

netsh wlan add profile filename=”FILENAME.xml”

Blocking unsecured wireless networks with filters

In order to add or remove filters using Netsh command line utility in Windows Vista, the Command Prompt must be in the Elevated state(Click the start button, type cmd, right-click the icon in the search box, and select Run As Administrator).

Here’s how to see a list of currently enabled filters:

Netsh wlan show filters

To add a filter, use the following syntax:

netsh wlan add filter permission={allow|block|denyall} ssid=NETWORKNAME networktype={infrastructure|adhoc}

To remove a filter:

netsh wlan delete filter permission={allow|block|denyall} ssid=NETWORKNAME networktype={infrastructure|adhoc}]

If using the permission of denyall, emit the SSID attribute. For example, to block the users from creating or connecting to ad hoc wireless connections, enter the following command:

netsh wlan add filter permission=denyall networktype=adhoc

If only allowing connections to chosen wireless network(s) and blocking all others is desired, a denyall infrastructure networks filter could be used in conjunction with the command to allow certain SSID filters. For example, to only give users the ability to connect to the network with the SSID of Dataone, use the following commands:

netsh wlan add filter permission=denyall networktype= infrastructure

netsh wlan add filter permission=allow ssid=Dataone networktype= infrastructure

By default, blocked wireless networks aren’t shown to the user on the Connect to a Network list. However, if displaying all networks is desired, the feature can be toggled using this syntax:

setblockednetworksdisplay={show|hide}

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Popularity: 13%

Did You Like This Post? Then You Might Find These Also Interesting:

Written by Tony on January 17th, 2009 with 1 comment.
Read more articles on Vista Networking.

Related articles

1 comment

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com EmJay
#1. March 16th, 2009, at 9:14 PM.

Tutorial works great! Can we automate the process of importing the xml file? instead of doing the netsh wlan add profile filename=”path of file.xml”, is there a way to do a batch file, script or just modify the xml file to a simple double click file? I would like to have just one file and double click it to import the wireless connection profile.

Thanks

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .