How to deploy a wireless profile using MDT

Problem:  How to deploy a wireless profile using MDT so that my laptops add onto the wireless network automatically.

Solution: First you have to export the wireless profile you need.  From a windows device that is already joined to the wireless network, open up a command prompt as administrator and you can run the following command:

   1: netsh wlan show profiles

This will show you a list of wireless profiles currently on the laptop. 
Chose the one you want and note the name of it. 
In my case the name of the wireless network is “Pretty fly for a WiFi”.

Now I must export this profile to an XML file.  To do this I use the command:

   1: netsh wlan export profile name="Pretty Fly for a WiFi" folder=C:\

(UAC TIP:  To save to C:\ you may need to run the cmd as administrator, otherwise specify another folder)

Now we need to edit the XML file to remove the security. Open the exported XML in notepad.  Find “<protected>true</protected>” and change to “<protected>false</protected>”.  Next, between the “<keyMaterial></keyMaterial>” tags there will be a long alphanumeric string.  Remove this string completely and place in your wireless password.  You should end up with something like this:

   1: <protected>false</protected>
   2: <keyMaterial>P@ssw0rD</keyMaterial>

(NOTE:  Your Wireless password will be in plain text, you may wish to implement more security on this I'm not that bothered)

OK now your XML file is ready for use! All we need to do now is place it in your task sequence.

The next part is personal preference really, I always store my scripts and their dependencies within the Scripts folder of my deploymentshare.  I create a subfolder called “Task_Sequence_Scripts” and place personal scripts and anything they need in there.  My XML file was copied to %deployroot%\Scripts\Task_Sequence_Scripts\Wireless_Profiles\Pretty Fly For a WiFi.xml

I built up a collection of many profiles and store them all in there.   You can now call this to be imported two different ways

Create a new “Run Command Line” underneath “State Restore”.  I generally place it inside the Custom Tasks group under State Restore. Then configure like so:


And that’s it! Give it a whirl and see if it works for you.  Pretty handy if you ask me!



Comments (4) -

Little Chris 5/26/2016 12:47:30 PM

Top stuff here Jonnie!  Helped me out for deploying Wi-Fi profiles for SCCM.

We need a catchup!

We certainly do Chris! Nice to hear from you.  I've sent you an email.

This isn't working for me -- could it be because they broke something in MDT 2013 Update 2? I'm alson not using SCCM, though, and deploying it with offline media (USB).

It didn't work for me. I am using MDT 2013 Update 2 to deploy Windows 10 x64 via light touch. This is my command line:
netsh wlan add profile filename="BOE.xml"
Start in:
I believe the error states that it could not find it. Are the scripts copied from the boot image to a virtual drive in WinPE? Or are they ran from the share on my deployment server?

Add comment