How to dump wireless network profile in Windows XP?

Hiya,

What I want to know is if there’s a method - in Windows XP or Home - to dump a wireless network profile config to a text file that can then be imported into another machine.

(In Vista and 7, you can do this via netsh wlan export profile and netsh wlan add profile, but the netsh WLAN functions never made it to XP.)

Background: I work for an IT department in a large school that caters to 3500+ laptops. We’ve recently set up a WPA-protected wireless network, but one geared towards Mac. (70+ of the user base) This means the Windows machines don’t automatically pick up the encryption and other information, like EAP-PEAP-MSCHAPv2 and PEAP server configuration.

Now, as it is, we have to configure all those laptops we get in manually. (Excluding those few who actually follow the manuals we’ve spread around all over the place.) This is eating up a lot of my time. What I want to make is an executable or logon script that can be distributed, that does this automatically.

What I’ve tried so far;

  • WCN (Windows Connect Now): In theory exports XP wireless settings to memory stick. Only problem is, the wizard only supports WPA nettworks with pre-shared keys, not individual logins. I managed to extract the wconfig.wfc file from it, where the wireless config is written, but I can’t find the command definitions for the things that are missing. (As in, I don’t know what the proper command to set EAP is. I know what it is in Vista and 7, but the commands are all subtly different in XP.)
  • Looking through all netsh commands. Sadly, netsh on XP only supports LAN. Netsh WLAN was supposed to be introduced in the now-exctinct Service Pack 4. sigh

This is really breaking my brain. Halp!

BTW: I can’t change the network itself, only on client basis.

Regards,
Andreas

I’m about 95% sure that many of those wireless settings are stored in the registry, could you build a registry patch that could then just be imported? You are dealing in multiple o/s environment so you may need several, but once you have the .reg file, should be easy to add it to a batch process to create the appropriate files & keys.

That might be it, but I wouldn’t know what to look for in the registry. It’s not exactly in plaintext. :stuck_out_tongue: But still, a lead worth following. I’ll see what it leads to. (And if anyone’s got any tips on what I ought to be looking for, I’d appreciate it a lot!)

For XP Pro boxes, can you do it via Group Policy?

Perhaps a silly question, but can you not run the Windows 7 version of netsh on XP?

Change all the settings to something wrong. Take a registry snapshot with something like RegShot, change them to what you want, and compare that with the first snapshot.

Or you can run Process Monitor and see what each change affects as you make it.

Next thing you will tell me is you read the matrix unencoded… :dubious: :smiley:

01001000 01100001 01101000 00101100 00100000 01100110 01100101 01100001 01110010 00100000 01101101 01111001 00100000 01100111 01101111 01100100 01101100 01101001 01101011 01100101 00100000 01110000 01101111 01110111 01100101 01110010 01110011 00100001

(Solved it, btw - let me know if anyone’s interested in the solution and I’ll put it up. What I’ve come up with has basically let me extract our WLAN settings and put them in a batch script that recognizes what Windows OS you’re running and installs the correct WLAN settings accordingly. Perfect for broad distribution.)

I would be very interested. Please post. This is exactly what I am trying to do.

Thanks!

I suspect this varies by manufacturer of the wireless hardware & software. I doubt there is any one “procedure”.

Im interested! Can you post your code for the .bat?

Hmm, since I’ve gotten quite a few PMs about this since I posted this, I’ll come clean. However, I quit the job I was working at so I don’t have the functional code written down any more, so I’m attempting to compile it by memory here.

First things first: I owe all credit to this guide from Symantec. All the tools and commands you’ll need are in there. Secondly, I’m not a professional programmer, so I’m probably going to mix things up a bit. Thirdly, you’ll probably need to fiddle with it a bit to make it work - I don’t have the original code I wrote and I don’t have an XP workstation any more to test it out on.

Preliminary note for people running XP SP2: You’ll need to download and install this: Wireless LAN API (KB918997). Then start the Wireless Zero config service. It’s supposed to auto-start after a reboot, but it’s wonky. It’s also worth your time in SP3 to make sure that Wireless Zero configuration service is running.

Preliminary note - tools needed: XP doesn’t come with its’ own set of Wireless Interface commands, which is why this is such a bother in the first place. You’ll need to download this tool, developed by Symantec, and run your commands through them. Home - Broadcom Community - Discussion Forums, Technical Docs, and Expert Blogs
If you’re making this as a tool to be run off a memory stick, I suggest putting it in the root folder of the memory stick. Otherwise, keep everything in one folder somewhere you can find it, like your desktop.

Let’s get started:
1.
Step one is to set up your Windows XP machine with the network you want to save and distribute. Make everything like it’s supposed to be. If your users will all be using their own set of passwords, remember not to enter your own username and password first. Just basically get it all set up the way you want your users to experience it. Delete every other wireless profile except the one you want to distribute in order to avoid confusion later.

**2. **Step 2 is aquiring the GUID of your network card. Open a command prompt in the folder where you unzipped the WLAN.exe file you downloaded from above and enter the following code:


wlan.exe ei

The above code will give you a return of the WLAN interfaces in your system. Write down the GUID for your wireless network card in notepad. (If you have multiple, or get false positives, experiment by disabling them one after one until you’re sure you know the right one.) The return might look something like this:


Interface 0: GUID: 89762a5d-bc6b-4ac6-8cf3-b0462b2bafef Intel(R) PRO/Wireless 3945ABG Network Connection - Teefer2 Miniport State: "disconnected" Command "ei" completed successfully.

You want the string behind “GUID:”

Step 3.
Step 3 is getting the profile list from the network card we isolated earlier. This is done by entering the following code:


wlan.exe gpl YOURGUIDNUMBERHERE

From Symantec’s example GUID above we get the following return:



"Profile1" 
Command "gpl" completed successfully.


For further reference, please note that the profile name is case sensitive.

**Step 4:
**In this step we aquire the network profile itself and save it to a .XML file. However, note that there is an error in the Symantec guide’s code. Their code would be:



wlan.exe gp Profile1


The correct code is:



wlan.exe gp YOURGUIDNUMBERHERE Profile1


But, if you have no need to read the XML itself, you can just use the following command to save it to a file instead, which is what you’ll need to do later anyway.


wlan.exe gp YOURGUIDNUMBERHERE Profile1 > C:\Wireless\Profile1.xml

Aaaaaand you’re done. You now have a saved copy of your wireless settings. In order to test it, delete your current network profile from your wireless and make sure you can’t connect to the internet. Then use the following command:


wlan.exe sp C:\Wireless\Profile1.xml

(You’re probably thinking of the lack of the GUID number in the import code. Don’t worry; if you don’t specify it, Windows will add it to all interfaces.)

That should work. Get back to me if it doesn’t, maybe I can remember something else.

I know there are probably more elegant solutions to this, using all kinds of fancy tools, but I just cracked together this with batch. Anyone has a better solution - for XP, mind - I’d be glad to hear it.

Now, in the PM, you also asked how to make it select by which OS you have. That part’s simple, just use the VER command to detect the OS and then use “if VER x goto” the part of your batch file which contains the appropriate command to set the network profile.

Good luck! As I said, it might take some fiddling, but it does work.