Tuesday, April 16, 2024
HomePowershellMonitoring with PowerShell: Monitoring WLAN studies

Monitoring with PowerShell: Monitoring WLAN studies


This can be a little bit of a brief one, however I’m making an attempt to get again to 2 blogs per week slowly, at the moment we’re speaking a few fairly cool characteristic that Microsoft has made for Home windows, however doesn’t get the eye it deserves. While you’re troubleshooting WLAN points there’s quite a lot of areas to research – If customers are reporting dropped networks you’ll need to verify the occasion logs, if customers are reporting authentication points you’ll need to verify the community settings.

This all will get actually complicated as a result of there’s simply so many logs and so many choices. Microsoft simplified this by creating the WLAN community reporting performance. You’ll be able to generate this report by executing the next command:

This generates a report in “C:ProgramDataMicrosoftWindowsWlanReportwlan-report-latest.html” which provides you a fairly cool overview of all occasions that occurred on the wi-fi community. The one draw back is that this report isn’t routinely generated so with intermittent points it’s a bit tougher to troubleshoot. For these circumstances, I’ve created the next monitoring script.

The Script

The script tries to generate a report every time it runs. If it may well’t write the script and it gained’t discover a file that’s newer than 4 hours, it’ll generate an alert that the studies aren’t there. You’ll nonetheless need to manually verify the report sadly, because it’s not a parsable report as a result of HTML magic in there.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
strive {
    $WLANReport = netsh wlan present wlanreport
    $WriteTime = Get-Merchandise "$($ENV:Systemdrive)ProgramDataMicrosoftWindowsWlanReportwlan-report-latest.html" | The place-Object { $_.lastWriteTime -gt (get-date).AddHours(-4) }
    if(!$WriteTime){ throw "No report present in final 4 hours." }
    write-host"Wholesome - Newest report could be discovered at $($ENV:Systemdrive)ProgramDataMicrosoftWindowsWlanReportwlan-report-latest.html"
}
catch {
    write-host "Couldn't discover newest report: $($_.Exception.Message)"
    exit 1
}

That’s all for at the moment. As all the time, Pleased PowerShelling 🙂

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments