0

I'm looking for a way to add a network profile to a system without importing the XML file. Does anyone know the actual syntax to enter in all of that data manually if you have it?

Below is an example of the XML file. Of course I could use this first snippet to do it, but I want to be able to manually. Is someone familiar with this process? I want to write a powershell script that inputs each of the necessary variables one by one.

netsh wlan add profile filename="C:\path\HOME.xml"
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
    <name>HOME</name>
    <SSIDConfig>
        <SSID>
            <hex>6D797374726F</hex>
            <name>mystro</name>
        </SSID>
    </SSIDConfig>
    <connectionType>ESS</connectionType>
    <connectionMode>manual</connectionMode>
    <MSM>
        <security>
            <authEncryption>
                <authentication>WPA2PSK</authentication>
                <encryption>AES</encryption>
                <useOneX>false</useOneX>
            </authEncryption>
            <sharedKey>
                <keyType>passPhrase</keyType>
                <protected>false</protected>
                <keyMaterial>password</keyMaterial>
            </sharedKey>
        </security>
    </MSM>
    <MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
        <enableRandomization>false</enableRandomization>
    </MacRandomization>
</WLANProfile>

I am Jakoby
  • 577
  • 4
  • 19
  • 2
    Would a PowerShell script that creates this xml file do the job? Fairly small xml, shouldn't be hard to write. – Darin Apr 16 '22 at 01:43
  • 2
    After posting the last comment, I began wondering if you could create a template text with the variables defined in it. Within a minute later I found this: https://stackoverflow.com/a/64288875/4190564 – Darin Apr 16 '22 at 01:50
  • 1
    Microsoft defines it as it is requiring XML - https://learn.microsoft.com/en-us/windows/win32/nativewifi/wlan-profileschema-wlanprofile-element – An-dir Apr 17 '22 at 07:04

1 Answers1

0

The answer was provided above in the form of a comment so I cannot accept it as an answer so I leave it here for anyone else that searches this. Apparently an EMF file is requirerd and manually programming in the variables is not possible at this time.

Microsoft defines it as it is requiring XML - https://learn.microsoft.com/en-us/windows/win32/nativewifi/wlan-profileschema-wlanprofile-element

I am Jakoby
  • 577
  • 4
  • 19