I want to find out the name of all my wlan along with their password:
ssid : password
With the search I made, I realized that it is possible to extract passwords individually with netsh But I need a batch script to get the name of each wlan, and extract and display the password for each name For example, I want the output to be like this:
ModemN1 : 123987654af
IsntModem : PASSw0rd!23
If you have another solution besides netsh, please tell me
can find all wlan profile:
C:> netsh wlan show profile
Profiles on interface Wi-Fi:
Group policy profiles (read only)
---------------------------------
<None>
User profiles
-------------
All User Profile : ModemN1
All User Profile : IsntModem
It should extract two ModemN1, IsntModem strings here
And for each of these strings, put the strings in this command:
netsh wlan show profile <WLAN_NAME> key=clear
C:> netsh wlan show profile IsntModem key=clear
Profile IsntModem on interface Wi-Fi:
=======================================================================
Applied: All User Profile
Profile information
-------------------
Version : 1
Type : Wireless LAN
Name : IsntModem
Control options :
Connection mode : Connect automatically
Network broadcast : Connect even if this network is not broadcasting
AutoSwitch : Do not switch to other networks
MAC Randomization : Disabled
Connectivity settings
---------------------
Number of SSIDs : 1
SSID name : "IsntModem"
Network type : Infrastructure
Radio type : [ Any Radio Type ]
Vendor extension : Not present
Security settings
-----------------
Authentication : WPA2-Personal
Cipher : CCMP
Authentication : WPA2-Personal
Cipher : GCMP
Security key : Present
Key Content : PASSw0rd!23
Cost settings
-------------
Cost : Unrestricted
Congested : No
Approaching Data Limit : No
Over Data Limit : No
Roaming : No
Cost Source : Default
and extract the password from here
Thank you for helping me ❤
I'm sure this has been parsed before though couldn't find a powershell duplicate for it, you can give this a try, seems to work fairly well:
netsh wlan show profile |
Select-String '(?<=All User Profile\s+:\s).+' |
ForEach-Object {
$wlan = $_.Matches.Value
$passw = netsh wlan show profile $wlan key=clear |
Select-String '(?<=Key Content\s+:\s).+'
[pscustomobject]@{
Name = $wlan
Password = $passw.Matches.Value
}
}
For the regex descriptions: