# evotecit/cleanupmonster architecture

> Architecture diagram of the GitHub repository evotecit/cleanupmonster, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/evotecit/cleanupmonster
- Repository: https://github.com/evotecit/cleanupmonster

## Overview

CleanupMonster is a PowerShell module for deliberate, reviewable cleanup of Active Directory objects and stale cloud device records. Administrators invoke one of four cleanup commands; each path begins with discovery and reporting, then supports its domain-specific actions and safeguards. The README documents the workflows and integrations, but no source excerpts were provided, so the graph reflects documented relationships only; implementation-level calls and data transfers are not verified.

Main entry points: [`Public/Invoke-ADComputersCleanup.ps1`](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADComputersCleanup.ps1) (Computer cleanup), [`Public/Invoke-CloudDevicesCleanup.ps1`](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-CloudDevicesCleanup.ps1) (Cloud-device cleanup), [`Public/Invoke-ADServiceAccountsCleanup.ps1`](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADServiceAccountsCleanup.ps1) (Service-account cleanup), [`Public/Invoke-ADSIDHistoryCleanup.ps1`](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADSIDHistoryCleanup.ps1) (SID history cleanup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_computers["Computer cleanup"]
  node_computer_cmd["Computer cleanup"]
  node_computer_review["Discovery and review"]
  node_computer_actions["Computer actions"]
end

subgraph group_cloud["Cloud-device cleanup"]
  node_cloud_cmd["Cloud-device cleanup"]
  node_cloud_review["Discovery and review"]
  node_cloud_actions["Cloud-device actions"]
end

subgraph group_service["Service-account cleanup"]
  node_service_cmd["Service-account cleanup"]
  node_service_review["Discovery and review"]
  node_service_actions["Service-account actions"]
end

subgraph group_sid["SID history cleanup"]
  node_sid_cmd["SID history cleanup"]
  node_sid_review["Discovery and review"]
  node_sid_actions["SID history removal"]
end

node_admin(("Administrator"))
node_ad[("Active Directory")]
node_azure[("Azure AD")]
node_intune[("Intune")]
node_jamf[("Jamf")]
node_entra[("Microsoft Entra")]
node_html["HTML reports"]

node_admin -->|"invokes"| node_computer_cmd
node_computer_cmd -->|"starts with discovery"| node_computer_review
node_computer_cmd -->|"supports cleanup actions"| node_computer_actions
node_computer_cmd -->|"cleans objects"| node_ad
node_computer_cmd -.->|"may cross-check"| node_azure
node_computer_cmd -.->|"may cross-check"| node_intune
node_computer_cmd -.->|"may cross-check"| node_jamf
node_computer_review -->|"generates review"| node_html
node_admin -->|"invokes"| node_cloud_cmd
node_cloud_cmd -->|"starts with discovery"| node_cloud_review
node_cloud_cmd -->|"supports cleanup actions"| node_cloud_actions
node_cloud_cmd -->|"retires devices"| node_intune
node_cloud_cmd -->|"disables or deletes"| node_entra
node_cloud_review -->|"generates review"| node_html
node_admin -->|"invokes"| node_service_cmd
node_service_cmd -->|"starts with discovery"| node_service_review
node_service_cmd -->|"supports cleanup actions"| node_service_actions
node_service_cmd -->|"cleans objects"| node_ad
node_service_review -->|"generates review"| node_html
node_admin -->|"invokes"| node_sid_cmd
node_sid_cmd -->|"starts with discovery"| node_sid_review
node_sid_cmd -->|"removes legacy entries"| node_sid_actions
node_sid_cmd -->|"cleans history"| node_ad
node_sid_review -->|"generates review"| node_html

click node_computer_cmd "https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADComputersCleanup.ps1"
click node_computer_review "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_computer_actions "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_cloud_cmd "https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-CloudDevicesCleanup.ps1"
click node_cloud_review "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_cloud_actions "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_service_cmd "https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADServiceAccountsCleanup.ps1"
click node_service_review "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_service_actions "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_sid_cmd "https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADSIDHistoryCleanup.ps1"
click node_sid_review "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_sid_actions "https://github.com/evotecit/cleanupmonster/tree/master/Private"
click node_html "https://github.com/evotecit/cleanupmonster/tree/master/Private"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_computer_cmd,node_computer_review,node_computer_actions toneBlue
class node_cloud_cmd,node_cloud_review,node_cloud_actions,node_ad,node_azure,node_intune,node_jamf,node_entra toneAmber
class node_service_cmd,node_service_review,node_service_actions toneMint
class node_sid_cmd,node_sid_review,node_sid_actions toneRose
class node_admin toneIndigo
class node_html toneTeal
```

## Components

### Computer cleanup

- [Computer cleanup](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADComputersCleanup.ps1): `Public/Invoke-ADComputersCleanup.ps1`
- [Discovery and review](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`
- [Computer actions](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`

### Cloud-device cleanup

- [Cloud-device cleanup](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-CloudDevicesCleanup.ps1): `Public/Invoke-CloudDevicesCleanup.ps1`
- [Discovery and review](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`
- [Cloud-device actions](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`

### Service-account cleanup

- [Service-account cleanup](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADServiceAccountsCleanup.ps1): `Public/Invoke-ADServiceAccountsCleanup.ps1`
- [Discovery and review](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`
- [Service-account actions](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`

### SID history cleanup

- [SID history cleanup](https://github.com/evotecit/cleanupmonster/blob/master/Public/Invoke-ADSIDHistoryCleanup.ps1): `Public/Invoke-ADSIDHistoryCleanup.ps1`
- [Discovery and review](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`
- [SID history removal](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`

### Other components

- **Administrator**
- **Active Directory**
- **Azure AD**
- **Intune**
- **Jamf**
- **Microsoft Entra**
- [HTML reports](https://github.com/evotecit/cleanupmonster/tree/master/Private): `Private`

## Connections

- Administrator → Computer cleanup: invokes (evidence: `README.MD`)
- Computer cleanup → Discovery and review: starts with discovery (evidence: `README.MD`)
- Computer cleanup → Computer actions: supports cleanup actions (evidence: `README.MD`)
- Computer cleanup → Active Directory: cleans objects (evidence: `README.MD`)
- Computer cleanup → Azure AD: may cross-check (evidence: `README.MD`)
- Computer cleanup → Intune: may cross-check (evidence: `README.MD`)
- Computer cleanup → Jamf: may cross-check (evidence: `README.MD`)
- Discovery and review → HTML reports: generates review (evidence: `README.MD`)
- Administrator → Cloud-device cleanup: invokes (evidence: `README.MD`)
- Cloud-device cleanup → Discovery and review: starts with discovery (evidence: `README.MD`)
- Cloud-device cleanup → Cloud-device actions: supports cleanup actions (evidence: `README.MD`)
- Cloud-device cleanup → Intune: retires devices (evidence: `README.MD`)
- Cloud-device cleanup → Microsoft Entra: disables or deletes (evidence: `README.MD`)
- Discovery and review → HTML reports: generates review (evidence: `README.MD`)
- Administrator → Service-account cleanup: invokes (evidence: `README.MD`)
- Service-account cleanup → Discovery and review: starts with discovery (evidence: `README.MD`)
- Service-account cleanup → Service-account actions: supports cleanup actions (evidence: `README.MD`)
- Service-account cleanup → Active Directory: cleans objects (evidence: `README.MD`)
- Discovery and review → HTML reports: generates review (evidence: `README.MD`)
- Administrator → SID history cleanup: invokes (evidence: `README.MD`)
- SID history cleanup → Discovery and review: starts with discovery (evidence: `README.MD`)
- SID history cleanup → SID history removal: removes legacy entries (evidence: `README.MD`)
- SID history cleanup → Active Directory: cleans history (evidence: `README.MD`)
- Discovery and review → HTML reports: generates review (evidence: `README.MD`)
