Skip to content

delprof2_delete_specific_profile.ps1

Corey Watson edited this page Dec 19, 2025 · 1 revision

delprof2_delete_specific_profile.ps1

Deletes ONLY the specified Windows user profile. All other profiles are left untouched.

Overview

This script uses the DelProf2 utility to remove a single specified Windows user profile while leaving all other profiles intact. It includes protection against deleting system-critical profiles.

Purpose

Deletes ONLY the specified Windows user profile. All other profiles are left untouched. Uses DelProf2 utility.

Prerequisites

  • Windows 10/11
  • Admin privileges required
  • Internet access for DelProf2 download

Configuration

Required Inputs

SuperOps Runtime Variables:

  • $profile_to_delete : Username of the profile to delete

Settings

  • Protects gaia, administrator from accidental deletion
  • Downloads DelProf2 directly (no Chocolatey required)
  • Cleans up after execution

Data Sources & Priority

  1. SuperOps runtime variables
  2. Direct download from helgeklein.com

Behavior

  1. Validates profile is not protected
  2. Downloads/extracts DelProf2 if not cached
  3. Executes: delprof2.exe /u /id:PROFILENAME
  4. Cleans up cached files
  5. Reports results

Security Notes

  • DESTRUCTIVE OPERATION - profile cannot be recovered
  • Downloads from official helgeklein.com source
  • Refuses to delete protected profiles

Exit Codes

  • 0: Success
  • 1: Failure

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
Profile to Delete : old.user
Protected         : gaia, administrator

[ OPERATION ]
--------------------------------------------------------------
Downloading DelProf2...
Extracting...
DelProf2 ready
Executing: DelProf2.exe /u /id:old.user
[DelProf2 output...]
Cleaning up...

Version History

  • 2025-11-29 v1.0.0 - Initial release - separated from combined script

Links

Clone this wiki locally