Project

CleanupMonster

This module provides an easy way to cleanup Active Directory from dead/old objects based on various criteria. It can also disable, move or delete objects. It can utilize Azure AD, Intune and Jamf to get additional information about objects before deleting them.

Stars138
Forks18
Open issues0
PowerShell Gallery downloads25529
Releasev3.1.7
Language: PowerShell Updated: 2026-03-10T14:49:12.0000000+00:00

Curated Examples

Preview stale computer cleanup

Use CleanupMonster to review stale computer cleanup without changing Active Directory.

This pattern is useful for the first pass of a computer cleanup engagement.

It is adapted from Examples/DeleteComputers.ps1.

Example

Import-Module CleanupMonster

$reportPath = Join-Path $PSScriptRoot 'Reports\CleanupComputersPreview.html'
$logPath = Join-Path $PSScriptRoot 'Logs\CleanupComputersPreview.log'

Invoke-ADComputersCleanup `
    -Disable `
    -Delete `
    -ReportOnly `
    -WhatIf `
    -ShowHTML `
    -ReportPath $reportPath `
    -LogPath $logPath

What this demonstrates

  • generating a reviewable cleanup report
  • keeping AD changes disabled with -ReportOnly and -WhatIf
  • writing output to script-local folders

Source