# Back up and restore audit policy

Back up and restore audit policy on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

AuditPolicy

AuditPolicy module aims to replace auditpol.exe to get or set Auditing Policies in Windows in more native PowerShell way

[View on GitHub](https://github.com/EvotecIT/AuditPolicy) [Visit Website](#) [Releases](https://github.com/EvotecIT/AuditPolicy/releases/tag/v0.0.6) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/AuditPolicy)

Stars**12**

Forks**2**

Open issues**0**

PowerShell Gallery downloads**25335**

Release**v0.0.6**

Language: PowerShell Updated: 2026-10-30

Curated Examples

Save Windows audit policy to a file and test restore paths with WhatIf.

This pattern is useful when audit policy changes need a rollback point.

It is adapted from `Examples/BackupAuditPolicies.ps1` and `Examples/RestoreAuditPolicies.ps1`.

## Example

```powershell
Import-Module AuditPolicy

$backupPath = Join-Path $PSScriptRoot 'Backups\AuditPolicy.json'
New-Item -ItemType Directory -Path (Split-Path $backupPath) -Force | Out-Null

Backup-SystemAuditPolicy | Out-File -FilePath $backupPath

Restore-SystemAuditPolicy -FilePath $backupPath -Verbose -WhatIf
Restore-SystemAuditPolicy -FilePath $backupPath -Policy 'Application Group Management' -Verbose -WhatIf
```

## What this demonstrates

- keeping a policy backup near the script
- testing restore behavior before applying it
- restoring a complete policy file or a selected policy

## Source

- [BackupAuditPolicies.ps1](https://github.com/EvotecIT/AuditPolicy/blob/master/Examples/BackupAuditPolicies.ps1)
- [RestoreAuditPolicies.ps1](https://github.com/EvotecIT/AuditPolicy/blob/master/Examples/RestoreAuditPolicies.ps1)

<!-- PowerForge markdown artifact sha256:DD1B3B77CCB6C4A14E4BCC143D6BCF50C4D03474F779C57F76B63D94935167AA -->
