Atliso-SecurityLogGuard

1.0.1

When the Security event log is set to Do Not Overwrite (LogMode=Retain) and fills
up, Windows can flip CrashOnAuditFail to 2, which locks out every non-administrator
until the log is cleared. This script catches the condition early and remediates it:
it resizes the log, sets it to overwrite as needed, and - if the lockout has already
tripped - archives and clears the
When the Security event log is set to Do Not Overwrite (LogMode=Retain) and fills
up, Windows can flip CrashOnAuditFail to 2, which locks out every non-administrator
until the log is cleared. This script catches the condition early and remediates it:
it resizes the log, sets it to overwrite as needed, and - if the lockout has already
tripped - archives and clears the log and resets CrashOnAuditFail from 2 to 1.

Runs audit-only by default (-WhatIf $true). Set -WhatIf $false to apply changes.

Intune usage: deploy as a Remediation. The detection half exits 1 when the log is
on Do Not Overwrite, at/over the warn threshold, full, or the lockout has tripped.
Run as SYSTEM, 64-bit.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Atliso-SecurityLogGuard

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Atliso. MIT License.

Package Details

Author(s)

  • Atliso

Tags

Intune Security EventLog CrashOnAuditFail Lockout Remediation

Functions

Write-Log

Dependencies

This script has no dependencies.

Release Notes

Never clears the Security log unless the archive succeeded. Every wevtutil call is checked.

FileList

Version History

Version Downloads Last updated
1.0.1 (current version) 8 10/23/2026