Syslog connector/parser for Microsoft NPS server logs
This tool has been tested on Server 2016 and Server 2022-based Microsoft NPS servers and is designed to run as an unprivileged local user with only read/list access needed to the NPS log folder.
- A Windows NPS server with PowerShell enabled
- A Syslog UDP collector to receive events
- Download the latest release .ZIP file
- Right-click the downloaded file, click Properties, and click "Unblock"
- Extract the .ZIP to a single directory
- Edit NPS-Syslog-Config.xml to match your environment settings
- Once you are familiar with the operation and have successfully backfilled your logs, you can create a scheduled task
- Open Computer Management and create a local user account with a strong password and no group membership beyond, "Users"
- Open mmc.exe and load the Local Group Policy Snap-In.
- Add the user you created to the, “Log on as a batch job” right.
- This can be found in Computer Configuration->Windows Settings->Local Policies->User Rights Assignments
- In Task Scheduler
- Configure a trigger of, "At startup."
- Configure a command of, "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
- Set the execution argument to, "-File C:\Path\To\Install\NPS-Syslog.ps1"
- Configure the task to run as the local user you created
- On first run, you will likely want to backfill data from logs currently in place on the NPS server.
- To do this, execute:
NPS-Syslog.ps1 $true
- Expect execution to take about 1 second for every 10MB of logfile. If you cancel before the process has completed, it will not save the backfill state.
- To do this, execute:
- On subsequent runs, simply execute NPS-Syslog.ps1
- If the parser has not run for some period of time, you can catch up by again running the backfill command.
- Edit this file to specify your Syslog UDP server details.
- If you have a RADIUS test user, specify that username in the "ignoreuser" field.
This is the main program script. The tool can process about 10MB of log data per second, so plan accordingly if you will be backfilling a large amount of data.
This file contains lookup functions for various log status fields, converting from numbers to human-readable text
- Open Computer Management and reset the password for the user. Always use a complex password with a minimum length of 15 characters.
- Once the password has been changed, open Task Scheduler and edit the task, specifying this new password when saving the task.
- Delete the backfilled.txt file
- Run
NPS-Syslog.ps1 $true
- Edit backfilled.txt and set the date (in YYMMDD format) to the file prior to where you would like to resume the backfill process.
- Run
NPS-Syslog.ps1 $true