Is it possible to programmatically add a wifi profile to a windows operating system (minimum version windows 7)?
I tried netsh with add profile and connect, but it doesn't work for me. Is there any powershell commands which does this?
I want to set a wifi password for a special ssid for many clients automatically.
I hope someone has an idea or can give me a command with this sample information:
Thanks
I wrote a power shell script - the first three lines in the following code havent been tested as in my script I get it from a CSV file - the rest is as is - and works on the two SSIds I have
$profilefile="ACprofile.xml"
$SSID="ACSSID"
$PW="12345678"
$SSIDHEX=($SSID.ToCharArray() |foreach-object {'{0:X}' -f ([int]$_)}) -join''
$xmlfile="<?xml version=""1.0""?>
<WLANProfile xmlns=""http://www.microsoft.com/networking/WLAN/profile/v1"">
<name>$SSID</name>
<SSIDConfig>
<SSID>
<hex>$SSIDHEX</hex>
<name>$SSID</name>
</SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>WPA2PSK</authentication>
<encryption>AES</encryption>
<useOneX>false</useOneX>
</authEncryption>
<sharedKey>
<keyType>passPhrase</keyType>
<protected>false</protected>
<keyMaterial>$PW</keyMaterial>
</sharedKey>
</security>
</MSM>
</WLANProfile>
"
$XMLFILE > ($profilefile)
netsh wlan add profile filename="$($profilefile)"
netsh wlan show profiles $SSID key=clear
netsh wlan connect name=$SSID
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With