# Documentation Status — Windows Profile Cleanup System v3.8

**Last updated:** June 2, 2026  
**Author:** Doug Hesseltine  
**Status:** Current with scripts in `/tools/profilecleanup/scripts/`

---

## Canonical system (production)

| Item | Value |
|------|--------|
| Main cleanup script | `ProfileCleanup.ps1` — **v3.8** |
| Report aggregator | `ProfileCleanup-Report.ps1` — **v2.2** |
| Domain deployment | `Deploy-ProfileCleanupSystem.ps1` — **v2.2** |
| Configuration | `\\<domain>\NETLOGON\ProfileCleanup\ProfileCleanup-Config.json` |
| Active users list | `AD-ActiveUsers.ps1` v1.0 (default **90** days; use `-Days` to match policy) |
| Version manifest | `manifest.json` (required for deploy validation) |
| Download URL | https://technologist.services/tools/profilecleanup/scripts/ |

### Supporting scripts (manifest-tracked)

| Script | Version | Purpose |
|--------|---------|---------|
| `Check-ProfileCleanupConfig.ps1` | 1.1 | Validate JSON, share, NETLOGON |
| `Purge-ProfileArchives.ps1` | 1.0 | Domain-wide purge of `C:\TEMP\ARCHIVE-*.zip` (default 35 days) |
| `Invoke-ProfileCleanup.ps1` | 1.0 | Scheduled-task / remote wrapper |
| `NCentral-ProfileCleanup-Launcher.ps1` | 2.0 | N-Central RMM entry point |
| `Pre-populate-LastUse_x_days_Old.ps1` | 1.1 | Backfill missing `.LastUse` files |
| `Pre-populate-LastUse_x_days_Old_RMM.ps1` | 1.0-RMM | RMM-safe variant |
| `AD-ActiveUsers.ps1` | 1.0 | Builds `ActiveUsers.csv` |
| `Set-DelProf2Hash.ps1` | (utility) | Update DelProf2 SHA256 in JSON |
| `lastuse.bat` / `PSBypass.bat` | 1.0 | GPO logon / execution-policy helper |
| `Generate-Manifest.ps1` | 1.0 | Regenerate `manifest.json` (authoring only) |

---

## Archive purge — two complementary mechanisms

| Mechanism | Default age | Scope | When it runs |
|-----------|-------------|-------|--------------|
| Built into **`ProfileCleanup.ps1` v3.8** | **30 days** (hardcoded) | Local `C:\TEMP\ARCHIVE-*.zip` on each PC | Every cleanup run |
| **`Purge-ProfileArchives.ps1` v1.0** | **35 days** (`-DaysOld`) | Domain-wide via WinRM | Manual or scheduled on DC |

The JSON field `Advanced.ArchiveRetentionDays` (365 in the template) is **not currently used** by either script.

---

## Log / report CSV columns (must match)

`ProfileCleanup.ps1` v3.8 and `ProfileCleanup-Report.ps1` v2.2 expect this header:

```
ComputerName,Username,ProfileAge,OverAgeLimit,NoLastUseFile,NoADAccount,Excluded,ProfileInUse,ActionTaken,Mode,ProcessedDateTime
```

Legacy **StaleUserCleanup.ps1 v0.13** (archive folder only) used 8 columns **without** `ComputerName`, `ProfileInUse`, or `ProcessedDateTime` — do not mix logs or reports between versions.

---

## Legacy scripts in download folder (do not deploy)

These files remain in the scripts directory for reference but are **not in `manifest.json`** and must not be used for new deployments:

| File | Version | Replaced by |
|------|---------|-------------|
| `Cleanup-WindowsProfiles.ps1` | 3.6 | `ProfileCleanup.ps1` |
| `Generate-ProfileReport.ps1` | 1.6 | `ProfileCleanup-Report.ps1` |
| `Initialize-ProfileCleanup.ps1` | 2.0 | `Deploy-ProfileCleanupSystem.ps1` |
| `Install-ProfileCleanupService.ps1` | 1.0 | `Deploy-ProfileCleanupSystem.ps1` |

---

## Retired names (do not document as current)

| Retired | Replaced by |
|---------|-------------|
| `StaleUserCleanup.ps1` | `ProfileCleanup.ps1` |
| `StaleUserCleanup.json` | `ProfileCleanup-Config.json` under `NETLOGON\ProfileCleanup\` |
| `Report-StaleUserCleanup.ps1` | `ProfileCleanup-Report.ps1` |
| `ActiveUsersList.ps1` | `AD-ActiveUsers.ps1` |
| `LastUseReport.ps1` | `ProfileCleanup-Report.ps1` |
| `Initialize-StaleUserCleanup.ps1` | `Deploy-ProfileCleanupSystem.ps1` / `Check-ProfileCleanupConfig.ps1` |

---

## Report output naming (v2.2)

Reports include the JSON `ClientName` in filenames:

```
ProfileCleanup-Report-{ClientName}-{yyyy-MM-dd_HHmmss}.html
ProfileCleanup-Report-{ClientName}-{yyyy-MM-dd_HHmmss}.csv
ProfileCleanup-Report-Summary-{ClientName}-{yyyy-MM-dd_HHmmss}.txt
```

Per-PC logs:

```
UserCleanUp-{COMPUTER}-{YYYYMMDD}.log
UserCleanUp-{COMPUTER}-{YYYYMMDD}.csv
```

---

## Command reference

### ProfileCleanup.ps1 (workstation / RMM)

```powershell
.\ProfileCleanup.ps1 -WhatIf -Report
.\ProfileCleanup.ps1 -ForceDoIt -Report
.\ProfileCleanup.ps1 -Domain contoso.com -IgnoreMaintenanceWindow -ForceDoIt
```

### AD-ActiveUsers.ps1 (domain controller)

```powershell
.\AD-ActiveUsers.ps1 -Days 90 -JsonConfigPath "\\contoso.com\netlogon\ProfileCleanup\ProfileCleanup-Config.json"
```

### Configuration check (domain controller)

```powershell
.\Check-ProfileCleanupConfig.ps1 -ProbeWrite -RefreshActiveUsers
```

Prerequisite checks run **inside** `Deploy-ProfileCleanupSystem.ps1` — there is no separate `Test-Prerequisites.ps1` file.

### Reports (management host)

```powershell
.\ProfileCleanup-Report.ps1
```

---

## Documentation map

| Document | Audience |
|----------|----------|
| `TECHNICIAN-QUICK-START.md` | Field technicians — start here |
| `Technician_Quickstart_Guide.html` | Same content, browser-friendly |
| `scripts/DEPLOYMENT-WORKFLOW.md` | Publishing scripts + manifest to this website |
| `README-DEPLOYMENT.md` | Full deployment |
| `DEPLOYMENT-SUMMARY.md` | Managers / overview |
| `Report-Quick-Reference.html` | Daily report operations (v2.2) |
| `Windows_Profile_Cleanup_Technical_Implementation.html` | Senior IT |
| `Windows_Profile_Cleanup_System_Overview.html` | Executive / business overview |

---

## Local development folder note

`Coding_Projects/staleusercleanup-archive/` holds an older **v0.13** tree. Treat **`web_tools/profilecleanup/scripts/`** as the deployment source of truth.

---

© 2026 Technologist.Services | Doug Hesseltine
