Import WLAN profiles with Powershell (and PDQ Deploy)

If you have multiple sites or as in our case, (construction)sites that come and go, you want an easy way to provide the Wifi keys to your users. Sure you can mail them around, update a list on the intranet. But would it not be convenient to automatically populate the list of WLAN profiles in your user’s notebooks?

To get this working you only have to run the following PowerShell script:

  1. List the available WLAN profiles on the machine.

netsh wlan show profiles

  • Then we need to export each profile that we want to distribute to a folder. We set the key to clear, otherwise the user still needs to enter the key. Keep in mind to store the profiles in a protected folder if necessary:

  • [code]
    netsh wlan export profile “SSID NAME” key=clear folder=”dir_to_xml_profiles”

  • The last step is to import the WLAN profiles on a (new) notebook. I added a step with this script in my baseline deployment for notebooks.

  • [code]
    <pre>$XmlDirectory = “dir_to_xml_profiles”
    Get-ChildItem $XmlDirectory | Where-Object {$_.extension -eq “.xml”} | ForEach-Object {netsh wlan add profile filename=($XmlDirectory+”\”+$}

    Thanks to Jan Egile Ring

    Get more stuff like this

    IT, Office365, Smart Home, PowerShell and Blogging Tips

    I hate spam to, so you can unsubscribe at any time.

    1 thought on “Import WLAN profiles with Powershell (and PDQ Deploy)”

    1. Get-ChildItem c:\NameOfDir | Where-Object {$ -like “Wi-FI*”} | ForEach-Object {netsh wlan add profile filename=(c:\NameOfDir+$}

      just change NameOfDir with your dir name and copy/paste to powershell windows

    Leave a Comment