Adding WiFi profiles to Windows can be done in many ways and most common is to deploy them thru a GPO created in your domain environment. Adding WiFi profiles manually is another way but requires that you know which network to access and how to configure. A third way and in some cases the best way to add WiFi profiles is to use script and deploy them thru your client management system.
In this article I describe how to create a command script that adds a WiFi profile and this can be used in your client management system, upKeeper Manager. There are many script languages that can be used to accomplish this but in this example we use batch script and a XML config file. Create file as specified below and replace [REPLACE_WITH_SSID] with your SSID and replace [REPLACE_WITH_PASSWORD] with password for specified SSID.
Important! Script files should be deleted from client immediately when used, because it contains wifi password.
Batch file (addssidprofile.cmd):
SET SSID=[REPLACE_WITH_SSID]
NETSH WLAN DELETE PROFILE %SSID%
NETSH WLAN ADD PROFILE FILENAME="wifiprofile.xml"
NETSH WLAN CONNECT NAME=%SSID%
XML file (wifiprofile.xml):
<?xml version="1.0"?> <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"> <name>[REPLACE_WITH_SSID]</name> <SSIDConfig> <SSID> <hex>XXXXXX</hex> <name>[REPLACE_WITH_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>[REPLACE_WITH_PASSWORD]</keyMaterial> </sharedKey> </security> </MSM> <MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3"> <enableRandomization>false</enableRandomization> </MacRandomization> </WLANProfile>
This script can be tweak to contain many profiles and be more dynamic but this is the basics.
Comments
0 comments
Please sign in to leave a comment.