How to find your wifi passwords in PowerShell

 Recently while working on migrating SSIDs from one manufacturers kit to another I found it necessary to check the PSK stored on Windows. The following PowerShell script is what I have been using to give me a concise list of the SSIDs and PSKs stored within Windows (Tested on Windows 10 and Windows 11).

1. Search for PowerShell in the start menu, right click on the entry and select run as administrator.

2. Enter the following commands and hit enter:

(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -Wrap

 

And thats it! it will output a nice list of the known Wi-Fi networks and their passwords.

Comments

Popular posts from this blog

NSE8 Lab Study Resources - Narbik CCIE R&S v5.1 Foundations

Journey to the NSE8 - Change in tactic

Specifying a domain name suffix for DHCP clients on a FortiGate (FortiOS)