Category filter

Script to fetch list of previously connected Wi-Fi networks on Windows

Administrators might want to monitor the Wi-Fi networks that their corporate devices connect to. It helps them ensure that the devices only connect to safe Wi-Fi networks. Hexnode lets admins
deploy scripts
to get a list of previously connected Wi-Fi networks.


The Sample Scripts provided below are adapted from third-party Open-Source sites.

Fetch the list of previously connected Wi-Fi networks

When the device is connected to a Wi-Fi network, it creates a WLAN profile that consists of details specific to the network.
The following Batch script retrieves a list of all Wi-Fi networks accessed from the device.

The PowerShell script to obtain the previously accessed Wi-Fi networks from a Windows device takes the following form:


  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository