A Windows WLAN Monitor Script

In Nov I sat Keith Parsons’s excellent ECSE Troubleshooting class. If you have not already taken this class I would highly recommend it along with the ESCE Design and ECSE Advance classes. During this class Keith was once again singing the praises of Adrian Granados’ WLAN tools for MAC, in particular, on this class the WiFi Signal tool. While giving praise and kudos to an awesome tool, Keith also lamented those of us who are poor Windows users who don’t have such a great tool and can’t easily access information about our current WLAN connection. In defence of the “poor Windows users” I tried to point out that we do have the ‘netsh wlan show interface’ command and you could script something similar. However, I realised that this was a weak argument because I didn’t possess a script to do this. So I decided write one.

Nigel Bowden had written a script to write WLAN netsh information to a file:

http://wifinigel.blogspot.com/2016/09/getting-data-out-of-windows-netsh-wlan.html

So I used Nigel’s script as a starting point and added a windows GUI and a few other bits and finally arrived at my PowerShell NetSh WLAN Monitor Script

This script provides the following features and functionality

  • A Windows GUI to continually monitor the output from the ‘netsh wlan show interface’ command
  • Configurable signal strength and data rate thresholds allow the users to control the levels at which the current signal strength and data rates will be disabled in green or red text.
  • An optional log – When logging is enabled, the output from each instance of the ‘netsh wlan show interface’ command will be written to a comma separated csv file in ASCII format so it can be easily opened by tools such as Excel.
  • A roaming log showing each roam.

By default Windows restricts the execution of Powershell scripts, so you will need to update the execution policy on your machine. To do this open a Powershell window and temporarily set the policy to unrestricted with this command:

Set-ExecutionPolicy Unrestricted -scope Process

Please note the first version of the script is still beta, so let me know about any bugs. But also let me know if you like it, should I continued to develop it? Some of the things I hope to add soon:

  • MAC OUI lookup
  • AP name lookup
  • Other WLAN metrics, such as MCS
  • Log configuration

While this script is no comparison to a professional tool such as Adrian’s WiFi Signal, I hope many of you will still find it useful. The script can be download here:

https://github.com/mackenziewifi/netsh-wlanmon

I hope you have fun with it, let me know your comments.

Note: This scripts only works for English windows systems and doesn’t work for other languages. I will look at updating this for other languages soon. Thanks Helge Magnus Keck for pointing this out.

Posted by pmackenzie

9 comments

Peter, thanks for creating this.

I am hitting a few errors when I run the PowerShell script:

At C:\WLANMon\WLANMon.ps1:149 char:19
+ Sign up
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks (“&”) to pass it as part of a string.
At C:\WLANMon\WLANMon.ps1:176 char:190
+ … ata-ga-click=”(Logged out) Header, go to Features”>Features <span cla …
+ ~
The '→Customer stories <span cla …
+ ~
The '→Security <span cla …
+ ~
The '→Explore GitHub <span cla …
+ ~
The '→Learn & con …
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks (“&”) to pass it as part of a string.
Not all parse errors were reported. Correct the reported errors and try again.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : AmpersandNotAllowed

Hi Jerod, It looks like you have the html from the GitHub page not the script. A few people have had this issues when copying the scrip from GitHub. I would recommend clicking the ‘Clone or download’ button on the GitHub page and then ‘download zip’. Hope this works for you.

Philip Gerundt

Really Cool idea will try it out.

Syslog logging may awesome as well or simply sending results via email so that I don’t need access to the pc to get the results

How did you get the rssi values??? Heavily interested in it

Thanks so much and a happy new year

Philip

Hi Philip, I like the syslog idea, maybe this will make it into the next version. The signal strength dBm value is calculated from the percentage, using the following calculation: dBm = (% / 2) – 100. However, I know this is not accurate for all adaptors, so I’m currently testing a more accurate way for getting this information.

Good morning and Happy New Year Peter. Thanks for sharing the tool.You mentioned other languages mutations, let me know if I can assist with Czech modification.
#jiriwifinet

Hi Jiri,

Yes if you can send me the output from the ‘netsh wlan show interface” command I can create a modified Czech version

Hello,

Could you add IP address? I.e. I have a issue where my devices are being placed on the wrong vlan bewteen roams so would be great to quickly see this.

Thanks

This will be in the next version

This is fantastic. Please continue to develop.
I would find it valuable if you can extract the AP hostname of your connected AP (field sent in the Beacon IE for some AP vendors Cisco etc).