Thursday, March 22, 2012

Automate Windows Vista/7/8 Wifi Profile Importing using NETSH

If you work in an enterprise environment that provides wireless you may find it necessary to constantly be configuring WiFi profiles for your users as they aren't able to do it themselves. With more advanced security features you can  implement with 802.1x for instance you may find that simply trying to connect to the WiFi network and entering in your credentials won't work - you need more manual configuration.

Well screw that! Let's make a batch file and do this in 2 clicks!



To start you will need to configure a test machine with all the wireless profiles configured manually (for the last time!).

Once you have those setup, it's time to export those profiles with NETSH.

Open up a command prompt and type:

netsh wlan show profiles 

This will show all profiles you have configured on your test machine.

netsh wlan export profile name="wifiprofile1" folder="c:\wifiprofiles\" 

Feel free to use whatever local or network drive you'd like to save these profiles on instead of c:\wifiprofiles.

Now, lets create a batch file we can use to import these new profiles to other laptops. Make sure to create this batch file in the same folder you saved your profiles in unless you want to specify the full path. Create a new text file with notepad but be sure to save it as a .bat or .cmd.

The general setup is below; add more profiles as necessary.


@echo off
echo.
echo Importing 802.1x Profiles
echo.
netsh wlan add profile filename="wifiprofile1.xml" user=all
netsh wlan add profile filename="wifiprofile2.xml" user=all
pause
And that's it. Either host this folder on a network share for users or yourself to grab and import over the wired network during initial laptop deployment or put it on your image in advance. You can even include this during sysprep to do this automatically.

NETSH is a super powerful command line tool that I will elaborate on more in later posts. For now, enjoy our automation!

9 comments:

  1. Hello, thanks for the info. But when I import this over to another laptop from my test laptop then running the batch script, it ask for the Security key. Anyway I can automate so the security key is imported as well?

    ReplyDelete
  2. This wonderful person seems to have fixed it with this method: http://theether.net/kb/100166

    ReplyDelete
  3. That has not worked for me in the past due to the unreliable nature of wifi sharing. You might connect to the phone's personal hotspot before leaving the house. electricalshop.net

    ReplyDelete
  4. This is less expensive than another switch; organize extenders have the capacity of boosting your WiFi broadband system flag particularly in the difficult to-achieve corners of your flat/home. Old switches can even be utilized as a system extender.dual band vs tri band

    ReplyDelete
  5. Tragically, Windows 8 was not the achievement Microsoft had sought after, with numerous clients griping about the gigantic takeoff far from recognizable designs. how to start writing a story

    ReplyDelete
  6. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
    top-5-best-gopro-wifi-remotes

    ReplyDelete
  7. Many thanks for the great posting. I am glad I have taken the time to see this. nerdy wifi puns

    ReplyDelete
  8. Very efficiently written information. It will be beneficial to anybody who utilizes it, including me. Keep up the good work. For sure i will check out more posts. This site seems to get a good amount of visitors. Unique wifi names

    ReplyDelete
  9. Without doing this, you may get amazed about the quantity of projects that set themselves naturally and run when you start up your PC or fiber association. boost wifi laptop

    ReplyDelete