Monitor Failed Logins To Windows VM

_nic
Jan 28, 2022

--

I wanted a simple way to make logins to some Azure VM’s more transparent. You can dig around in the Event Logs for failed logins, but I wanted to monitor for a failed login, write a log file, send it to InfluxDB, visualize with Grafana, and send an alert.

My solution Consist of two files on disk.

  • A Scheduled Task that monitors “Microsoft Event” logs for Event ID: 4625
  • A powershell script that writes a log file on disk and sends an Invoke-WebRequest to an InfluxDB server with the data in Line Protocol (to be visualized with Grafana for setting alerts)

Once it’s up and running, it’s been great and easy to copy and setup on other serves.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

_nic
_nic

Written by _nic

Occasionally I Do Useful Things

No responses yet

Write a response