Scripting the addition of a Wireless Profile
I posted in another thread recently about an issue I'm having with Win7 laptops losing their wireless profile.
Well, to help remedy this I've exported the wireless profile to a .xml file and created a script with the following:
netsh wlan add profile filename="Wireless Network Connection Name.xml"
However, for some reason, on some of the laptops, it creates the profile but when attempting to connect to it, it still prompts for the security key (although it is in the .xml file). This effectively makes the script useless, as we don't really want
to give that out to all of the users.
Anyone know what's going on here?
December 6th, 2011 12:10am
Hi,
How did you export your current profile?
Have you tried the following command to test?
export profile folder= PathAndFileName [[name=]ProfileName] key=clear
From the following article, the way to import profile without prompt, is to have the passkey unencrypted. To do so, add the key=clear,
when specified, it means that if a key is present in the profile and the user has administrative privileges on the local computer:
WPA2-Personal Profile SampleAlex Zhao
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
December 7th, 2011 10:47pm
Hi,
How did you export your current profile?
Have you tried the following command to test?
export profile folder= PathAndFileName [[name=]ProfileName] key=clear
From the following article, the way to import profile without prompt, is to have the passkey unencrypted. To do so, add the key=clear,
when specified, it means that if a key is present in the profile and the user has administrative privileges on the local computer:
WPA2-Personal Profile Sample
Alex Zhao
TechNet Community Support
I exported the profile with the following command: netsh wlan export profile name=”SSID”
If I open the .xml file, I can see the encrypted key.
Are you saying that I need to specify that the key is "clear," which will include the key in the .xml file in plain text? If so, what is the purpose of the method that I use which encrypts the key in the .xml file?
I'll do some more testing in the meantime with the information you've given me.
December 8th, 2011 3:49pm
Also, like I noted in my original post, this only happens sometimes. Just now, as I was about to test your ideas, I first attempted to run the script with the encrypted key so that it would fail and I could then run the script based on the
plaintext key.
However, the initial attempt with the encrypted key worked successfully, although I've seen it prompt for the key on users' computers, as well as a laptop sitting right in front of me. (also, the users are local admins in all instances)
edit - actually even if I run the script as a non-Admin user (at least on this laptop I'm testing with now) it works properly.
Free Windows Admin Tool Kit Click here and download it now
December 8th, 2011 4:06pm
Hi,
Are there existed wireless profiles in your computers?
Please try to clear your previous profiles and then try again. If you open the Network and Sharing Center, then click on "Manage wireless networks" you can remove
all saved wireless network profiles.
You could also delete them via netsh command, specifies the name of the wireless profile to delete.Alex Zhao
TechNet Community Support
December 9th, 2011 4:28am
Hi,
Are there existed wireless profiles in your computers?
Please try to clear your previous profiles and then try again. If you open the Network and Sharing Center, then click on "Manage wireless networks" you can remove
all saved wireless network profiles.
You could also delete them via netsh command, specifies the name of the wireless profile to delete.
Alex Zhao
TechNet Community Support
The profile that we are using is the only one that these computers have in their profile list (so when it randomly disappears, there are no profiles remaining).
Free Windows Admin Tool Kit Click here and download it now
December 9th, 2011 8:18am