Employee Offboarding Automation Framework
Auto Delete Profile is a Python-based automation tool designed to streamline the employee offboarding process for vendor organizations. This framework provides a centralized, extensible solution for managing employee profile deletions across multiple vendor systems through an intuitive graphical interface.
Auto Delete Profile eliminates manual, error-prone offboarding processes by automating employee profile deletion workflows. The tool supports multiple vendor integrations through a modular architecture, allowing organizations to maintain a single interface for managing offboarding tasks across different vendor platforms.
The application features a user-friendly Tkinter GUI that enables IT administrators to select vendors, input employee identifiers, and execute bulk deletion operations with comprehensive logging and error handling.
- Multi-Vendor Support: Extensible architecture supports integration with multiple vendor systems
- Dynamic Module Loading: Vendor modules are loaded dynamically from a registry configuration
- Intuitive GUI Interface: User-friendly Tkinter-based interface for streamlined operations
- Bulk Processing: Process multiple employee deletions in a single operation
- Windows Profile Deletion: Automatically removes local user profiles from
C:\Users\<username> - Comprehensive Logging: All operations are logged with timestamps to
logs/offboarding.log - Error Handling: Robust exception handling with detailed error reporting
- Threaded Execution: Non-blocking GUI during offboarding operations
- Template System: Includes vendor template for rapid integration of new vendors
- Python: 3.8 or higher
- Operating System: Windows (required for local profile deletion functionality)
- Dependencies:
- Tkinter (typically included with Python on Windows)
- All other dependencies are part of the Python standard library
-
Clone or download the repository
git clone <repository-url> cd Auto_Delete_Profile
Or extract the project folder to your desired location.
-
Verify Python installation
python --version
Ensure Python 3.8 or higher is installed.
-
Navigate to project directory
cd Auto_Delete_Profile -
Run the application
python Auto_Delete_Profile.py
The application will launch with the GUI interface. The logs/ directory will be created automatically on first run.
- Open a terminal or command prompt
- Navigate to the
Auto_Delete_Profiledirectory - Run:
python Auto_Delete_Profile.py
-
Select a Vendor
- Use the dropdown menu labeled "Select Vendor"
- Choose the vendor organization for which you want to perform offboarding
-
Enter Employee IDs
- In the text area, enter employee usernames or IDs
- Enter one identifier per line
- Example:
employee001 employee002 employee003
-
Run Offboarding
- Click the "Run Offboarding" button
- The button will be disabled during processing
- Monitor progress in the output console below
-
Review Results
- The output console displays real-time status updates
- A summary is shown after completion
- Check
logs/offboarding.logfor detailed audit trail
-
Clear Output (optional)
- Click "Clear Output" to clear the console display
The application follows a multi-stage workflow for each employee:
- Vendor Deletion: Calls the vendor-specific module's
delete_employees()function - Local Profile Deletion: Removes the Windows user profile from
C:\Users\<username> - Logging: All operations are logged with timestamps and status
- Error Handling: Failures for individual employees don't stop processing of others
The system processes employees sequentially but runs in a separate thread to keep the GUI responsive. Each operation's success or failure is tracked and reported.
The application follows a modular architecture with clear separation of concerns:
┌─────────────────────────────────────────────────────────┐
│ main_gui.py │
│ (Tkinter GUI) │
│ (OffboardingGUI class) │
└─────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ employee_offboarding_engine.py │
│ (Orchestration Layer) │
│ (OffboardingEngine class) │
└──────────┬─────────────────────────────┬────────────────┘
│ │
▼ ▼
┌─────────────────────┐ ┌─────────────────────────────┐
│ vendor_employee_ │ │ local_profile_delete.py │
│ loader.py │ │ (Windows Profile Removal) │
│ (Dynamic Loading) │ │ delete_local_profile() │
└─────────┬───────────┘ └─────────────────────────────┘
│
▼
┌─────────────────────┐
│ vendors/*.py │
│ (Vendor Modules) │
│ delete_employees() │
└─────────────────────┘
Auto_Delete_Profile.py: Application entry point that launches the GUIgui/main_gui.py: Tkinter interface handling user input and displaying resultscore/employee_offboarding_engine.py: Orchestrates the offboarding workflowcore/vendor_employee_loader.py: Dynamically loads vendor modules from registrycore/local_profile_delete.py: Handles Windows profile directory deletioncore/logger.py: Centralized logging configurationcore/vendor_employee_registry.json: Configuration mapping vendor names to modulesvendors/*.py: Vendor-specific deletion implementations
To integrate a new vendor into the system:
-
Copy
vendors/template_vendor_employee.pytovendors/your_vendor_name.py -
Replace the placeholder logic in
delete_employees()with your vendor's API calls or deletion logic -
Ensure the function returns a list of dictionaries with this structure:
[ { "employee": "employee_id", "success": True, "message": "Description of operation" } ]
-
Open
core/vendor_employee_registry.json -
Add an entry mapping the display name to the module path:
{ "Allied Universal": "vendors.allied_universal", "Your Vendor Name": "vendors.your_vendor_name" }
- Restart the application
- Verify your vendor appears in the dropdown menu
- Test with sample employee data
- Must implement
delete_employees(employee_list: List[str]) -> List[Dict] - Should use the logger from
core.loggerfor consistent logging - Should handle errors gracefully and return appropriate success/failure status
The application automatically deletes Windows local user profile directories as part of the offboarding process.
- Target Path:
C:\Users\<username> - Method: Uses
shutil.rmtree()with error handling - Safety Checks:
- Verifies directory exists before deletion
- Handles permission errors gracefully
- Logs all operations for audit purposes
- Administrator privileges may be required for some profile deletions
- Profiles that are currently in use may fail with permission errors
- The operation will attempt deletion but will log failures without stopping the overall process
Common scenarios:
- Profile doesn't exist: Logged as informational (may have been already deleted)
- Permission denied: Logged as error (profile may be in use)
- File in use: Logged as error with details
All errors are logged to both the console output and the log file.
All operations are logged to logs/offboarding.log with the following format:
YYYY-MM-DD HH:MM:SS | LEVEL | MODULE_NAME | MESSAGE
- Rotation: Log files rotate when they reach 10MB
- Retention: Keeps 5 backup files
- Encoding: UTF-8 encoding for proper character support
- Dual Output: Logs appear in both the file and console
- File:
logs/offboarding.log - Directory: Automatically created on first run
2024-01-15 14:30:25 | INFO | core.employee_offboarding_engine | Starting offboarding for vendor 'Allied Universal' with 3 employees
2024-01-15 14:30:26 | INFO | vendors.allied_universal | [Allied Universal] Processing removal: employee001
2024-01-15 14:30:27 | INFO | core.local_profile_delete | Successfully deleted local profile: C:\Users\employee001
Potential improvements and extensions:
- Active Directory Integration: Automatically disable AD accounts during offboarding
- Email Notifications: Send completion emails to administrators
- Database Logging: Store offboarding history in a database for reporting
- Batch Import: Load employee lists from CSV or Excel files
- Scheduled Operations: Support for scheduled offboarding runs
- Web Dashboard: Browser-based interface as alternative to desktop GUI
- Multi-Threading: Parallel processing for faster bulk operations
- Progress Bars: Visual progress indicators for long-running operations
- Rollback Capabilities: Undo mechanisms for accidental deletions
- Configuration File: External configuration for default settings
- Audit Reports: Generate PDF or HTML reports of offboarding operations
- Access Control: Restrict application access to authorized IT personnel only
- Audit Logging: All operations are logged for compliance and auditing
- Employee Data: Handle employee identifiers in accordance with data protection policies
- Vendor Credentials: Store API keys and tokens securely (use environment variables or secure vaults)
- Network Security: Ensure vendor API connections use encrypted protocols (HTTPS/TLS)
- Error Messages: Avoid exposing sensitive information in error messages
- Code Review: Review vendor module implementations before production deployment
Important: This tool performs destructive operations. Ensure appropriate safeguards, confirmation workflows, or approval processes are in place per your organization's policies.
- Verify Python 3.8+ is installed:
python --version - Ensure Tkinter is available (included with standard Python on Windows)
- Check for syntax errors:
python -m py_compile Auto_Delete_Profile.py
- Verify the vendor is registered in
core/vendor_employee_registry.json - Check the module path matches the actual file location
- Ensure the vendor module file exists and has no syntax errors
- Review
logs/offboarding.logfor import errors
- Ensure the application is running with appropriate permissions
- Check if the profile is currently in use (user logged in)
- Verify the profile path exists:
C:\Users\<username> - Review log file for specific error messages
- Ensure you're running from the project root directory
- Verify all
__init__.pyfiles are present - Check that module paths in the registry match actual file locations
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 [Your Name]
For questions, issues, or contributions related to Auto Delete Profile, please contact the development team or repository owner.
Version: 1.0.0
Last Updated: 2024