diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a6e73f6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# PowerShell +*.ps1xml + +# Logs +*.log + +# Temporary files +*.tmp +*.temp +~* + +# User specific files +*.user + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio Code +.vscode/ +*.code-workspace + +# Windows +Thumbs.db +ehthumbs.db +Desktop.ini +$RECYCLE.BIN/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fdff6bf --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,161 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0] - 2025-12-08 + +### Added + +#### Core Functionality +- PowerShell-based ProxyAddress manager with modern WPF GUI +- User search functionality (by DisplayName, SamAccountName, or Mail) +- Display all ProxyAddresses for selected user +- Add new ProxyAddresses with type selection (SMTP, smtp, SIP, X400, X500) +- Remove existing ProxyAddresses with confirmation +- Set primary SMTP address functionality +- Automatic demotion of existing primary when setting new primary +- Real-time status updates in status bar +- Refresh functionality to reload user data + +#### User Interface +- Modern WPF interface with professional styling +- Blue theme with Microsoft-style design +- User list with search results +- ProxyAddresses data grid with sortable columns +- Type, Address, and Primary status display +- Expandable "Add New ProxyAddress" section +- Status bar with timestamp +- Confirmation dialogs for destructive operations +- Warning dialog when removing primary SMTP address +- Button states (enabled/disabled based on context) +- Keyboard shortcuts (Enter key support) + +#### Validation & Error Handling +- Email format validation using .NET MailAddress class +- Duplicate ProxyAddress detection +- Empty input validation +- Proper error messages with context +- Try-catch blocks around all AD operations +- Graceful error recovery + +#### Security Features +- Verification of Active Directory module availability +- Proper WPF threading model (Dispatcher.Invoke) +- No credential storage (uses current Windows credentials) +- Confirmation dialogs for all destructive operations +- Input validation and sanitization +- Limited AD query results (50 users max) +- Optimized AD queries with ResultSetSize parameter + +#### Documentation +- Comprehensive README.md with feature overview +- QUICKSTART.md for rapid onboarding +- INSTALLATION.md with detailed setup instructions +- EXAMPLES.md with real-world usage scenarios +- CONTRIBUTING.md with contribution guidelines +- SECURITY.md with security considerations +- LICENSE file (MIT License) +- This CHANGELOG.md file + +#### Configuration +- .gitignore for PowerShell projects +- Git-friendly file structure +- Professional repository setup + +### Technical Details + +#### PowerShell Features Used +- WPF/XAML for GUI +- ActiveDirectory module integration +- .NET Framework assemblies (PresentationFramework, PresentationCore, WindowsBase) +- Event-driven programming model +- Advanced parameter validation +- Proper error handling patterns + +#### AD Operations +- Get-ADUser with filtered queries +- Set-ADUser for modifications +- Add, Remove, and Replace operations on ProxyAddresses +- Proper handling of multi-valued attributes + +#### Code Quality +- Follows PowerShell best practices +- Clear function separation +- Comprehensive comments +- Consistent naming conventions +- Proper indentation (4 spaces) +- CmdletBinding support + +### Fixed +- XAML inline event handlers removed (used Add_* methods instead) +- System.Windows.Forms.DoEvents() replaced with proper WPF Dispatcher +- AD query optimization (changed from Select-Object -First to -ResultSetSize) +- Email validation improved (regex replaced with .NET MailAddress) +- Removed unused System.Windows.Forms assembly reference + +### Security +- Input validation prevents injection attacks +- Proper error handling prevents information disclosure +- WPF threading model prevents reentrancy issues +- Limited query results prevent resource exhaustion +- Confirmation dialogs prevent accidental data loss + +## [Unreleased] + +### Planned for v1.1.0 +- Export/Import ProxyAddresses to/from CSV +- Batch operations for multiple users +- Advanced search filters +- Domain-specific filtering +- ProxyAddress templates +- Dark mode theme option + +### Planned for v1.2.0 +- Configuration file support +- Custom default values +- Logging to file +- Audit trail functionality +- Undo/Redo capability + +### Planned for v2.0.0 +- Multi-language support (English/German) +- MS Graph API integration (direct MS365 access) +- Advanced reporting features +- Scheduled tasks support +- PowerShell module packaging + +### Under Consideration +- Digital code signing +- MSI installer +- Automatic updates +- Integration with ticketing systems +- Approval workflow +- Read-only mode +- Rollback functionality +- Pre-change backups + +--- + +## Version History Overview + +- **1.0.0** (2025-12-08): Initial release with core functionality + +--- + +## How to Read This Changelog + +- **Added**: New features +- **Changed**: Changes in existing functionality +- **Deprecated**: Soon-to-be removed features +- **Removed**: Removed features +- **Fixed**: Bug fixes +- **Security**: Security improvements + +## Links + +- [GitHub Repository](https://github.com/PS-easyIT/easyEXCH-ProxyMailAddresses) +- [Issues](https://github.com/PS-easyIT/easyEXCH-ProxyMailAddresses/issues) +- [Pull Requests](https://github.com/PS-easyIT/easyEXCH-ProxyMailAddresses/pulls) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cb360d3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,51 @@ +# Contributing to easyEXCH ProxyAddress Manager + +Thank you for considering contributing to easyEXCH ProxyAddress Manager! + +## How to Contribute + +### Reporting Bugs + +If you find a bug, please create an issue with: +- Clear description of the bug +- Steps to reproduce +- Expected behavior +- Actual behavior +- Environment details (Windows version, PowerShell version, AD environment) + +### Suggesting Enhancements + +Enhancement suggestions are welcome! Please create an issue with: +- Clear description of the enhancement +- Use cases +- Expected benefits +- Any implementation ideas + +### Pull Requests + +1. Fork the repository +2. Create a new branch for your feature (`git checkout -b feature/amazing-feature`) +3. Make your changes +4. Test thoroughly +5. Commit your changes (`git commit -m 'Add amazing feature'`) +6. Push to the branch (`git push origin feature/amazing-feature`) +7. Open a Pull Request + +### Code Style + +- Follow PowerShell best practices +- Use proper indentation (4 spaces) +- Add comments for complex logic +- Use meaningful variable names +- Include error handling + +### Testing + +- Test your changes in a safe AD environment +- Test with different user scenarios +- Verify no existing functionality breaks +- Test error handling + +## Questions? + +Feel free to open an issue for any questions! diff --git a/EXAMPLES.md b/EXAMPLES.md new file mode 100644 index 0000000..6263354 --- /dev/null +++ b/EXAMPLES.md @@ -0,0 +1,311 @@ +# Beispiele / Examples + +## Grundlegende Verwendung / Basic Usage + +### 1. Benutzer suchen / Search for User + +```powershell +# Starten Sie die Anwendung / Start the application +.\easyEXCH-ProxyMailAddresses.ps1 + +# In der GUI / In the GUI: +# 1. Geben Sie einen Suchbegriff ein (z.B. "Mueller" oder "max.mueller@contoso.com") +# 2. Klicken Sie auf "Search" oder drücken Sie Enter +# 3. Wählen Sie den gewünschten Benutzer aus der Liste +``` + +### 2. ProxyAddress hinzufügen / Add ProxyAddress + +**Beispiel: Sekundäre E-Mail-Adresse hinzufügen** + +``` +1. Benutzer auswählen: Max Müller +2. Klick auf "Add Address" +3. Typ auswählen: "smtp (Secondary)" +4. Adresse eingeben: max.mueller@contoso.de +5. Klick auf "Save" + +Ergebnis: +- smtp:max.mueller@contoso.de wird hinzugefügt +- Benutzer kann jetzt E-Mails an beide Adressen empfangen +``` + +**Beispiel: SIP-Adresse für Teams hinzufügen** + +``` +1. Benutzer auswählen: Max Müller +2. Klick auf "Add Address" +3. Typ auswählen: "SIP" +4. Adresse eingeben: max.mueller@contoso.com +5. Klick auf "Save" + +Ergebnis: +- sip:max.mueller@contoso.com wird hinzugefügt +- Wird für Microsoft Teams/Skype verwendet +``` + +### 3. Primäre E-Mail-Adresse ändern / Change Primary Email + +**Szenario: Benutzer wechselt von alter zu neuer Domain** + +``` +Ausgangssituation: +- SMTP:max.mueller@oldcompany.com (primär) +- smtp:m.mueller@oldcompany.com (alias) + +Schritte: +1. Neue Adresse hinzufügen: + - Typ: "smtp (Secondary)" + - Adresse: max.mueller@newcompany.com + +2. Neue Adresse als primär setzen: + - max.mueller@newcompany.com in Liste auswählen + - Klick auf "Set Primary" + - Bestätigen mit "Yes" + +Ergebnis: +- SMTP:max.mueller@newcompany.com (primär) ✓ +- smtp:max.mueller@oldcompany.com (alias) +- smtp:m.mueller@oldcompany.com (alias) +``` + +## Erweiterte Szenarien / Advanced Scenarios + +### Szenario 1: Migration zu MS365 + +**Situation**: Lokaler Exchange Server wird abgeschaltet, Migration zu MS365 + +``` +Vor der Migration: +- SMTP:max.mueller@contoso.local (primär, on-premises) +- smtp:m.mueller@contoso.local (alias) + +Migrations-Schritte: + +1. MS365-Adresse als sekundär hinzufügen: + Typ: smtp (Secondary) + Adresse: max.mueller@contoso.com + +2. Testen der neuen Adresse: + - E-Mail an max.mueller@contoso.com senden + - Empfang bestätigen + +3. MS365-Adresse als primär setzen: + - max.mueller@contoso.com auswählen + - "Set Primary" klicken + +4. ADSync laufen lassen: + - Warten auf Synchronisation + - In MS365 prüfen + +Nach der Migration: +- SMTP:max.mueller@contoso.com (primär, MS365) ✓ +- smtp:max.mueller@contoso.local (alias, für Übergangszeit) +- smtp:m.mueller@contoso.local (alias) +``` + +### Szenario 2: Abteilungswechsel mit E-Mail-Änderung + +**Situation**: Mitarbeiter wechselt von Sales zu Marketing + +``` +Vor dem Wechsel: +- SMTP:max.mueller@sales.contoso.com (primär) +- smtp:m.mueller@sales.contoso.com (alias) + +Schritte: + +1. Neue Marketing-Adresse hinzufügen: + Typ: smtp (Secondary) + Adresse: max.mueller@marketing.contoso.com + +2. Zusätzlichen Alias hinzufügen: + Typ: smtp (Secondary) + Adresse: m.mueller@marketing.contoso.com + +3. Übergangsphase (2 Wochen): + - Beide Adressen funktionieren + - E-Mail-Signatur aktualisieren + - Kollegen informieren + +4. Marketing-Adresse als primär setzen: + - max.mueller@marketing.contoso.com auswählen + - "Set Primary" klicken + +Nach dem Wechsel: +- SMTP:max.mueller@marketing.contoso.com (primär) ✓ +- smtp:m.mueller@marketing.contoso.com (alias) +- smtp:max.mueller@sales.contoso.com (alias, temporär) +- smtp:m.mueller@sales.contoso.com (alias, temporär) + +Nach Übergangsphase: +- Alte Sales-Adressen entfernen (optional) +``` + +### Szenario 3: Mehrere E-Mail-Aliase für Service-Account + +**Situation**: Service-Account für verschiedene Kontaktpunkte + +``` +Benötigte Aliase für support@contoso.com: + +1. Hauptadresse hinzufügen/setzen: + SMTP:support@contoso.com (primär) + +2. Mehrere Aliase hinzufügen: + smtp:help@contoso.com + smtp:service@contoso.com + smtp:helpdesk@contoso.com + smtp:kundenservice@contoso.com + smtp:support@contoso.de + +Ergebnis: +- Alle E-Mails an diese Adressen landen im selben Postfach +- Flexibilität bei Marketing-Materialien +- Verschiedene Sprach-Domains abgedeckt +``` + +### Szenario 4: Externe E-Mail-Domain hinzufügen + +**Situation**: Firma übernimmt andere Firma, deren E-Mail-Domain behalten + +``` +Hauptfirma: contoso.com +Übernommene Firma: fabrikam.com + +Schritte für betroffene Mitarbeiter: + +1. Aktuelle contoso.com Adresse bleibt primär: + SMTP:john.doe@contoso.com + +2. Fabrikam-Alias hinzufügen: + Typ: smtp (Secondary) + Adresse: john.doe@fabrikam.com + +3. Optional weitere Fabrikam-Aliase: + smtp:j.doe@fabrikam.com + +Ergebnis: +- Mitarbeiter erreichbar unter beiden Domains +- Fabrikam-Kunden können weiter alte Adressen nutzen +- Schrittweise Migration möglich +``` + +## PowerShell-Äquivalente / PowerShell Equivalents + +Für Automatisierung oder Batch-Operationen: + +### ProxyAddress hinzufügen + +```powershell +# Sekundäre SMTP-Adresse hinzufügen +$user = Get-ADUser -Identity "mmüller" -Properties ProxyAddresses +Set-ADUser -Identity $user -Add @{ProxyAddresses="smtp:max.mueller@contoso.de"} + +# SIP-Adresse hinzufügen +Set-ADUser -Identity "mmüller" -Add @{ProxyAddresses="sip:max.mueller@contoso.com"} +``` + +### Primäre SMTP-Adresse ändern + +```powershell +$user = Get-ADUser -Identity "mmüller" -Properties ProxyAddresses +$newAddresses = @() + +# Alle existierenden Adressen durchgehen +foreach ($addr in $user.ProxyAddresses) { + if ($addr -like "SMTP:*") { + # Alte primäre zu sekundärer machen + $newAddresses += $addr -replace "^SMTP:", "smtp:" + } else { + $newAddresses += $addr + } +} + +# Neue primäre Adresse hinzufügen +$newAddresses += "SMTP:max.mueller@newcompany.com" + +# Alle Adressen setzen +Set-ADUser -Identity $user -Replace @{ProxyAddresses=$newAddresses} +``` + +### ProxyAddress entfernen + +```powershell +# Einzelne Adresse entfernen +Set-ADUser -Identity "mmüller" -Remove @{ProxyAddresses="smtp:old.address@contoso.com"} +``` + +### Alle ProxyAddresses anzeigen + +```powershell +# Alle ProxyAddresses eines Benutzers +$user = Get-ADUser -Identity "mmüller" -Properties ProxyAddresses +$user.ProxyAddresses | ForEach-Object { + if ($_ -match "^([^:]+):(.+)$") { + [PSCustomObject]@{ + Type = $matches[1] + Address = $matches[2] + IsPrimary = ($matches[1] -ceq $matches[1].ToUpper()) + } + } +} | Format-Table -AutoSize +``` + +## Häufige Fehler und Lösungen / Common Errors and Solutions + +### Fehler: "This proxy address already exists" + +``` +Ursache: Sie versuchen eine bereits vorhandene Adresse hinzuzufügen +Lösung: Prüfen Sie die Liste der vorhandenen Adressen +``` + +### Fehler: "Invalid email format" + +``` +Ursache: E-Mail-Adresse entspricht nicht dem Standard-Format +Lösung: Prüfen Sie das Format (user@domain.com) +Beispiele gültig: + ✓ max.mueller@contoso.com + ✓ m.mueller@sub.contoso.com + ✓ mueller_max@contoso.de + +Beispiele ungültig: + ✗ max.mueller (fehlt @domain) + ✗ @contoso.com (fehlt Benutzername) + ✗ max..mueller@contoso.com (doppelter Punkt) +``` + +### Warnung: "You are about to remove the primary SMTP address" + +``` +Ursache: Sie versuchen die primäre SMTP-Adresse zu entfernen +Auswirkung: E-Mail-Empfang könnte beeinträchtigt werden +Empfehlung: + 1. Zuerst andere Adresse als primär setzen + 2. Dann alte primäre Adresse entfernen +``` + +## Best Practices + +1. **Vor größeren Änderungen**: + - Screenshot der aktuellen ProxyAddresses machen + - Änderungen dokumentieren + - Bei kritischen Accounts: Mit Test-User erst testen + +2. **Bei Domain-Wechsel**: + - Neue Adresse erst als sekundär hinzufügen + - Einige Tage parallel laufen lassen + - Dann als primär setzen + - Alte Adresse noch einige Wochen als Alias behalten + +3. **Bei Problemen**: + - Refresh-Button verwenden für aktuelle Daten + - ADSync-Status prüfen + - In MS365 Admin Center gegenchecken + +4. **Regelmäßig**: + - Ungenutzte Aliase entfernen + - Konsistenz der Adressformate prüfen + - Dokumentation aktuell halten diff --git a/INSTALLATION.md b/INSTALLATION.md new file mode 100644 index 0000000..1f7c9cf --- /dev/null +++ b/INSTALLATION.md @@ -0,0 +1,235 @@ +# Installation Guide for easyEXCH ProxyAddress Manager + +## Prerequisites Installation + +### 1. Install RSAT Tools (Active Directory PowerShell Module) + +#### Windows 10/11 (Version 1809 or later) + +Open PowerShell as Administrator and run: + +```powershell +# Check if already installed +Get-WindowsCapability -Name RSAT.ActiveDirectory* -Online + +# Install RSAT-AD-PowerShell +Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 + +# Verify installation +Import-Module ActiveDirectory +Get-Module ActiveDirectory +``` + +#### Windows 10 (Older versions) + +1. Download RSAT from Microsoft Download Center +2. Install RSAT package +3. Enable Active Directory module in Windows Features + +#### Windows Server 2016/2019/2022 + +```powershell +# Check if already installed +Get-WindowsFeature -Name RSAT-AD-PowerShell + +# Install RSAT-AD-PowerShell +Install-WindowsFeature -Name RSAT-AD-PowerShell -IncludeAllSubFeature + +# Verify installation +Import-Module ActiveDirectory +Get-Module ActiveDirectory +``` + +### 2. Check PowerShell Version + +```powershell +# Check PowerShell version (requires 5.1 or higher) +$PSVersionTable.PSVersion + +# Output should show Major version 5 or higher +``` + +### 3. Check .NET Framework Version + +```powershell +# Check .NET Framework version (requires 4.5 or higher) +Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" | Select-Object Release, Version + +# Release numbers: +# 378389 = .NET 4.5 +# 378675/378758 = .NET 4.5.1 +# 379893 = .NET 4.5.2 +# 393295/393297 = .NET 4.6 +# 394254/394271 = .NET 4.6.1 +# 394802/394806 = .NET 4.6.2 +# 460798/460805 = .NET 4.7 +# 461308/461310 = .NET 4.7.1 +# 461808/461814 = .NET 4.7.2 +# 528040/528049 = .NET 4.8 +``` + +## Application Installation + +### Method 1: Git Clone + +```powershell +# Clone repository +git clone https://github.com/PS-easyIT/easyEXCH-ProxyMailAddresses.git + +# Navigate to folder +cd easyEXCH-ProxyMailAddresses + +# Run application +.\easyEXCH-ProxyMailAddresses.ps1 +``` + +### Method 2: Direct Download + +1. Download ZIP file from GitHub +2. Extract to desired location +3. Right-click on file → Properties → Unblock (if necessary) +4. Open PowerShell in extracted folder +5. Run: `.\easyEXCH-ProxyMailAddresses.ps1` + +## PowerShell Execution Policy + +If you encounter execution policy errors: + +```powershell +# Check current policy +Get-ExecutionPolicy -List + +# Set policy for current user (recommended) +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +# Alternative: Set policy for current process only (temporary) +Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process + +# Verify new policy +Get-ExecutionPolicy +``` + +## Active Directory Permissions + +The user running the script needs: + +### Minimum Required Permissions: +- Read permissions on User objects in AD +- Write permissions on ProxyAddresses attribute + +### How to Verify Permissions: + +```powershell +# Test AD connectivity +Import-Module ActiveDirectory + +# Test user search +Get-ADUser -Filter {SamAccountName -eq "testuser"} -Properties ProxyAddresses + +# Test if you can read ProxyAddresses +$user = Get-ADUser -Filter {SamAccountName -eq "testuser"} -Properties ProxyAddresses +$user.ProxyAddresses +``` + +### Granting Permissions (Domain Admin): + +If you need to grant specific permissions: + +1. Open "Active Directory Users and Computers" +2. View → Advanced Features +3. Right-click on OU containing users → Properties +4. Security tab → Advanced +5. Add → Select principal +6. Select user/group that needs access +7. Permissions: + - Read all properties + - Write proxyAddresses + +## Troubleshooting Installation + +### Issue: "Cannot load ActiveDirectory module" + +**Solution:** +```powershell +# Verify RSAT is installed +Get-WindowsCapability -Name RSAT.ActiveDirectory* -Online | Where-Object State -eq "Installed" + +# Try manual import +Import-Module ActiveDirectory -Verbose + +# Check module location +Get-Module -ListAvailable ActiveDirectory +``` + +### Issue: "Script is not digitally signed" + +**Solution:** +```powershell +# Option 1: Change execution policy +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +# Option 2: Unblock file +Unblock-File -Path ".\easyEXCH-ProxyMailAddresses.ps1" + +# Option 3: Run with bypass (one-time) +PowerShell.exe -ExecutionPolicy Bypass -File ".\easyEXCH-ProxyMailAddresses.ps1" +``` + +### Issue: "WPF window not showing" + +**Solution:** +```powershell +# Verify .NET Framework +[System.Reflection.Assembly]::GetEntryAssembly().ImageRuntimeVersion + +# Check WPF assemblies +[System.Reflection.Assembly]::LoadWithPartialName("PresentationFramework") +[System.Reflection.Assembly]::LoadWithPartialName("PresentationCore") + +# Try running as different user with admin rights +``` + +### Issue: "Access Denied" when modifying ProxyAddresses + +**Solution:** +- Verify you have write permissions on ProxyAddresses attribute +- Contact Domain Administrator for necessary permissions +- Test with a user account you own + +## Post-Installation Verification + +```powershell +# Test script +.\easyEXCH-ProxyMailAddresses.ps1 + +# Application should: +# 1. Load without errors +# 2. Display WPF window +# 3. Show "Ready" in status bar +# 4. Allow user search (test with known user) +``` + +## Creating Desktop Shortcut (Optional) + +1. Right-click on Desktop → New → Shortcut +2. Location: `powershell.exe -ExecutionPolicy Bypass -File "C:\Path\To\easyEXCH-ProxyMailAddresses.ps1"` +3. Name: "easyEXCH ProxyAddress Manager" +4. Click Finish +5. Right-click shortcut → Properties +6. Change icon (optional) +7. Run as administrator (if needed) + +## Network Requirements + +- Access to Domain Controllers +- DNS resolution working +- Firewall allows LDAP (389/tcp, 636/tcp) +- Kerberos authentication (88/tcp, 88/udp) + +## Support + +If you continue to have installation issues: +1. Check prerequisites are met +2. Review error messages +3. Open issue on GitHub with details +4. Include PowerShell version, Windows version, and error messages diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..48d5c72 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 PS-easyIT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/QUICKSTART.md b/QUICKSTART.md new file mode 100644 index 0000000..5cf2124 --- /dev/null +++ b/QUICKSTART.md @@ -0,0 +1,247 @@ +# Quick Start Guide - easyEXCH ProxyAddress Manager + +## 🚀 Schnellstart in 3 Schritten + +### Schritt 1: Voraussetzungen prüfen ✓ + +```powershell +# PowerShell als Administrator öffnen + +# 1. PowerShell Version prüfen (mindestens 5.1) +$PSVersionTable.PSVersion + +# 2. Active Directory Modul prüfen +Get-Module -ListAvailable ActiveDirectory + +# Falls nicht vorhanden, installieren: +Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 +``` + +### Schritt 2: Anwendung starten 🖥️ + +```powershell +# 1. In das Verzeichnis wechseln +cd C:\Path\To\easyEXCH-ProxyMailAddresses + +# 2. Falls erforderlich: Ausführungsrichtlinie anpassen +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +# 3. Anwendung starten +.\easyEXCH-ProxyMailAddresses.ps1 +``` + +### Schritt 3: Benutzer verwalten 👤 + +**3.1 Benutzer suchen** +``` +1. Suchfeld: Namen eingeben (z.B. "Müller") +2. Enter drücken oder "Search" klicken +3. Benutzer aus Liste auswählen +``` + +**3.2 ProxyAddress hinzufügen** +``` +1. "Add Address" klicken +2. Typ auswählen (z.B. "smtp (Secondary)") +3. Adresse eingeben (z.B. "alias@domain.com") +4. "Save" klicken +``` + +**3.3 Primäre Adresse ändern** +``` +1. Gewünschte Adresse in Liste auswählen +2. "Set Primary" klicken +3. Mit "Yes" bestätigen +``` + +**3.4 ProxyAddress entfernen** +``` +1. Zu entfernende Adresse auswählen +2. "Remove" klicken +3. Mit "Yes" bestätigen +``` + +## 📝 Erste Schritte - Praxisbeispiel + +### Beispiel: Alias für Benutzer hinzufügen + +**Ausgangssituation:** +- Benutzer: Max Müller +- Aktuelle E-Mail: max.mueller@contoso.com +- Benötigt: Zusätzlichen Alias m.mueller@contoso.com + +**Vorgehensweise:** + +1. **Anwendung starten** + ```powershell + .\easyEXCH-ProxyMailAddresses.ps1 + ``` + +2. **Benutzer suchen** + - Suchfeld: "Müller" eingeben + - Enter drücken + - "Max Müller" aus Liste wählen + +3. **Aktuellen Status prüfen** + - ProxyAddresses-Liste zeigt: + - `SMTP:max.mueller@contoso.com` (Primary) + +4. **Neuen Alias hinzufügen** + - "Add Address" klicken + - Typ: "smtp (Secondary)" auswählen + - Adresse: "m.mueller@contoso.com" eingeben + - "Save" klicken + +5. **Ergebnis prüfen** + - ProxyAddresses-Liste zeigt nun: + - `SMTP:max.mueller@contoso.com` (Primary) + - `smtp:m.mueller@contoso.com` (Secondary) ✓ + +✅ **Fertig!** Max Müller erhält jetzt E-Mails an beide Adressen. + +## 🎯 Häufige Aufgaben + +### Aufgabe 1: MS365 Migration vorbereiten + +``` +Ziel: Lokale Adresse durch MS365-Adresse ersetzen + +Schritte: +1. MS365-Adresse als sekundär hinzufügen +2. Einige Tage testen +3. MS365-Adresse als primär setzen +4. Alte lokale Adresse als Alias behalten (optional) + +Details siehe: EXAMPLES.md - Szenario 1 +``` + +### Aufgabe 2: Service-Account mit mehreren Kontaktpunkten + +``` +Ziel: Ein Postfach für mehrere E-Mail-Adressen + +Schritte: +1. Primäre Adresse festlegen (z.B. SMTP:support@domain.com) +2. Weitere Aliase hinzufügen: + - smtp:help@domain.com + - smtp:service@domain.com + - smtp:helpdesk@domain.com + +Ergebnis: Alle E-Mails landen im selben Postfach +``` + +### Aufgabe 3: Nach Abteilungswechsel E-Mail ändern + +``` +Ziel: Von sales@domain.com zu marketing@domain.com wechseln + +Schritte: +1. Neue Adresse als sekundär hinzufügen +2. Übergangsphase einplanen (z.B. 2 Wochen) +3. Neue Adresse als primär setzen +4. Alte Adresse später entfernen (optional) + +Details siehe: EXAMPLES.md - Szenario 2 +``` + +## ⚠️ Wichtige Hinweise + +### ✓ Do's +- Änderungen in Testumgebung zuerst testen +- Screenshots von wichtigen Konfigurationen machen +- Bei primärer SMTP-Änderung: Übergangsphase einplanen +- Nach Änderungen: ADSync-Status prüfen +- Refresh-Button verwenden für aktuelle Daten + +### ✗ Don'ts +- Primäre SMTP-Adresse nicht ohne Plan entfernen +- Keine ungültigen E-Mail-Formate verwenden +- Nicht direkt in Produktion ohne Test arbeiten +- ADSync nicht ignorieren (kann bis zu 30 Min. dauern) + +## 🆘 Häufige Probleme + +### Problem: "Active Directory module is not installed" +```powershell +# Lösung: RSAT installieren +Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 + +# PowerShell neu starten +``` + +### Problem: "Execution Policy" Fehler +```powershell +# Lösung: Richtlinie anpassen +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +# Oder einmalig: +PowerShell.exe -ExecutionPolicy Bypass -File ".\easyEXCH-ProxyMailAddresses.ps1" +``` + +### Problem: "Access Denied" +``` +Lösung: +- Prüfen Sie Ihre AD-Berechtigungen +- Kontaktieren Sie Ihren Domain-Administrator +- Benötigt: Lese- und Schreibrechte auf ProxyAddresses-Attribut +``` + +### Problem: GUI wird nicht angezeigt +``` +Lösung: +- .NET Framework 4.5+ installiert? +- Als anderer Benutzer anmelden +- Windows Updates installieren +``` + +## 📚 Weitere Ressourcen + +- **Detaillierte Installation:** [INSTALLATION.md](INSTALLATION.md) +- **Umfangreiche Beispiele:** [EXAMPLES.md](EXAMPLES.md) +- **Vollständige Dokumentation:** [README.md](README.md) +- **Probleme melden:** [GitHub Issues](https://github.com/PS-easyIT/easyEXCH-ProxyMailAddresses/issues) + +## 🎓 Video-Tutorials (geplant) + +- [ ] Grundlagen: Erste Schritte +- [ ] MS365 Migration durchführen +- [ ] Mehrere Aliase verwalten +- [ ] Troubleshooting häufiger Probleme + +## 💡 Tipps für Fortgeschrittene + +### Tipp 1: PowerShell-Befehle für Batch-Operationen +```powershell +# Für viele Benutzer: Siehe EXAMPLES.md +# Für Automatisierung: PowerShell-Scripts verwenden +``` + +### Tipp 2: Desktop-Verknüpfung erstellen +``` +Rechtsklick Desktop → Neu → Verknüpfung +Ziel: powershell.exe -ExecutionPolicy Bypass -File "C:\Pfad\zur\Datei.ps1" +Name: easyEXCH ProxyAddress Manager +``` + +### Tipp 3: Regelmäßige Wartung +``` +- Alle 6 Monate: Ungenutzte Aliase prüfen +- Vor großen Änderungen: Backup erstellen +- Nach Updates: Funktionalität testen +``` + +## 📞 Support + +Bei Fragen: +1. README.md und Dokumentation lesen +2. EXAMPLES.md für Ihr Szenario prüfen +3. GitHub Issues durchsuchen +4. Neues Issue erstellen mit: + - Beschreibung des Problems + - Fehlermeldung (falls vorhanden) + - Schritte zur Reproduktion + - Umgebungsdetails (Windows, PowerShell Version) + +--- + +**Viel Erfolg mit easyEXCH ProxyAddress Manager! 🚀** diff --git a/README.md b/README.md index 0631f5c..a7cc9e5 100644 --- a/README.md +++ b/README.md @@ -1 +1,284 @@ -# easyEXCH-ProxyMailAddresses \ No newline at end of file +# easyEXCH ProxyAddress Manager + +![PowerShell](https://img.shields.io/badge/PowerShell-5.1%2B-blue.svg) +![License](https://img.shields.io/badge/license-MIT-green.svg) +![Version](https://img.shields.io/badge/version-1.0.0-orange.svg) + +**easyEXCH ProxyAddress Manager** ist ein PowerShell-basiertes Tool mit moderner WPF-GUI zur Verwaltung von ProxyMailAddresses in Active Directory. Es wurde speziell für Umgebungen entwickelt, in denen kein lokaler Exchange Server mehr vorhanden ist, aber MS365 ADSync verwendet wird. + +## 🌟 Features + +- **Moderne WPF-GUI**: Benutzerfreundliche grafische Oberfläche mit modernem Design +- **Benutzersuche**: Schnelle Suche nach AD-Benutzern über DisplayName, SamAccountName oder E-Mail +- **ProxyAddress-Verwaltung**: + - Anzeigen aller ProxyAddresses eines Benutzers + - Hinzufügen neuer ProxyAddresses (SMTP, smtp, SIP, X400, X500) + - Entfernen bestehender ProxyAddresses + - Festlegen der primären SMTP-Adresse +- **Validierung**: Automatische E-Mail-Format-Validierung +- **Sicherheit**: Warnmeldungen bei kritischen Operationen +- **Status-Updates**: Echtzeit-Statusmeldungen für alle Operationen + +## 📋 Voraussetzungen + +### Software-Anforderungen + +- **Windows PowerShell 5.1** oder höher +- **Active Directory PowerShell Module** (RSAT-Tools) +- **.NET Framework 4.5** oder höher (für WPF) + +### Installation RSAT-Tools + +**Windows 10/11:** +```powershell +# Als Administrator ausführen +Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 +``` + +**Windows Server:** +```powershell +# Als Administrator ausführen +Install-WindowsFeature -Name RSAT-AD-PowerShell +``` + +### Berechtigungen + +Der ausführende Benutzer benötigt: +- Leseberechtigung für Active Directory-Benutzer +- Schreibberechtigung für ProxyAddresses-Attribut der zu verwaltenden Benutzer + +## 🚀 Installation + +1. **Repository klonen oder herunterladen:** + ```powershell + git clone https://github.com/PS-easyIT/easyEXCH-ProxyMailAddresses.git + cd easyEXCH-ProxyMailAddresses + ``` + +2. **Ausführungsrichtlinie prüfen (falls erforderlich):** + ```powershell + # Aktuelle Richtlinie anzeigen + Get-ExecutionPolicy + + # Falls erforderlich, Richtlinie für aktuellen Benutzer ändern + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + ``` + +3. **Skript ausführen:** + ```powershell + .\easyEXCH-ProxyMailAddresses.ps1 + ``` + +## 📖 Verwendung + +### Benutzeroberfläche + +Die Anwendung besteht aus mehreren Hauptbereichen: + +#### 1. User Search (Benutzersuche) +- Geben Sie einen Suchbegriff ein (Name, SamAccountName oder E-Mail) +- Klicken Sie auf "Search" oder drücken Sie Enter +- Die Ergebnisse werden in der Benutzerliste angezeigt (max. 50 Ergebnisse) + +#### 2. Users (Benutzerliste) +- Zeigt alle gefundenen Benutzer an +- Wählen Sie einen Benutzer aus, um dessen ProxyAddresses anzuzeigen + +#### 3. ProxyAddresses (ProxyAddresses-Verwaltung) +- **Liste**: Zeigt alle ProxyAddresses des ausgewählten Benutzers + - Type: Art der Adresse (SMTP, smtp, SIP, etc.) + - Address: Die eigentliche E-Mail-Adresse oder URI + - Primary: Kennzeichnet die primäre Adresse (nur eine pro Typ) + +- **Aktionen**: + - **Add Address**: Neue ProxyAddress hinzufügen + - **Set Primary**: Ausgewählte Adresse als primär festlegen + - **Remove**: Ausgewählte Adresse entfernen + - **Refresh**: ProxyAddresses aktualisieren + +### Schritt-für-Schritt-Anleitung + +#### ProxyAddress hinzufügen + +1. Benutzer suchen und auswählen +2. Klick auf "Add Address" +3. Adresstyp auswählen: + - **SMTP (Primary)**: Primäre SMTP-Adresse (nur eine pro Benutzer) + - **smtp (Secondary)**: Sekundäre SMTP-Adresse (mehrere möglich) + - **SIP**: Session Initiation Protocol Adresse (z.B. für Skype/Teams) + - **X400**: X.400-Adresse (Legacy) + - **X500**: X.500-Distinguished Name (Legacy) +4. E-Mail-Adresse oder URI eingeben +5. Klick auf "Save" + +#### Primäre SMTP-Adresse ändern + +1. Benutzer auswählen +2. Gewünschte sekundäre SMTP-Adresse in der Liste markieren +3. Klick auf "Set Primary" +4. Bestätigung mit "Yes" +5. Die bisherige primäre Adresse wird automatisch zur sekundären Adresse + +#### ProxyAddress entfernen + +1. Benutzer auswählen +2. Zu entfernende Adresse in der Liste markieren +3. Klick auf "Remove" +4. Bestätigung mit "Yes" +5. **Hinweis**: Beim Entfernen der primären SMTP-Adresse erscheint eine zusätzliche Warnung + +## 🔧 Technische Details + +### ProxyAddress-Format + +ProxyAddresses in Active Directory folgen diesem Format: `TYPE:address` + +- **SMTP** (Großbuchstaben): Primäre SMTP-Adresse (Reply-To) +- **smtp** (Kleinbuchstaben): Sekundäre SMTP-Adressen (Alias) +- **sip**: SIP-Adresse für Unified Communications +- **X400**: X.400-Adresse für Legacy-Systeme +- **X500**: X.500-Distinguished Name + +### Beispiele + +``` +SMTP:max.mustermann@contoso.com # Primäre E-Mail-Adresse +smtp:max@contoso.com # Alias +smtp:m.mustermann@contoso.com # Weiterer Alias +sip:max.mustermann@contoso.com # SIP-Adresse +``` + +### Active Directory-Integration + +Das Tool verwendet folgende PowerShell-Cmdlets: + +- `Get-ADUser`: Benutzer suchen und laden +- `Set-ADUser`: ProxyAddresses modifizieren + - `-Add`: ProxyAddress hinzufügen + - `-Remove`: ProxyAddress entfernen + - `-Replace`: ProxyAddresses ersetzen (für primäre Adresse) + +## 🛡️ Sicherheit + +### Warnsysteme + +- **Primäre SMTP-Adresse**: Warnung beim Entfernen oder Ändern +- **Duplikate**: Prüfung auf bereits vorhandene Adressen +- **Format-Validierung**: E-Mail-Adressen werden validiert + +### Best Practices + +1. **Sicherung**: Erstellen Sie ein Backup vor größeren Änderungen +2. **Testen**: Testen Sie Änderungen zunächst mit Testbenutzern +3. **Dokumentation**: Dokumentieren Sie wichtige Änderungen +4. **Berechtigungen**: Vergeben Sie nur notwendige Berechtigungen + +## 🔍 Fehlerbehebung + +### "Active Directory module is not installed" + +**Lösung**: RSAT-Tools installieren (siehe Voraussetzungen) + +### "Access Denied" / Zugriff verweigert + +**Lösung**: +- Prüfen Sie Ihre AD-Berechtigungen +- Führen Sie das Skript als Benutzer mit entsprechenden Rechten aus + +### Skript startet nicht + +**Lösung**: +```powershell +# Ausführungsrichtlinie prüfen +Get-ExecutionPolicy + +# Falls zu restriktiv +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser +``` + +### GUI wird nicht angezeigt + +**Lösung**: +- Prüfen Sie, ob .NET Framework 4.5+ installiert ist +- Prüfen Sie, ob Windows WPF-Komponenten verfügbar sind + +## 📝 Verwendungsszenarien + +### Szenario 1: Migration zu MS365 + +Bei der Migration von lokalem Exchange zu MS365: +1. Benutzer hat noch alte lokale SMTP-Adresse als primär +2. Fügen Sie neue MS365-Adresse als sekundär hinzu +3. Setzen Sie MS365-Adresse als primär +4. ADSync synchronisiert Änderungen zu MS365 + +### Szenario 2: Alias-Verwaltung + +Benutzer benötigt zusätzliche E-Mail-Aliase: +1. Suchen Sie den Benutzer +2. Fügen Sie weitere smtp:-Adressen hinzu +3. MS365 akzeptiert E-Mails an alle Aliase + +### Szenario 3: Abteilungswechsel + +Benutzer wechselt Abteilung und benötigt neue E-Mail: +1. Fügen Sie neue SMTP-Adresse als sekundär hinzu +2. Testen Sie die neue Adresse +3. Setzen Sie neue Adresse als primär +4. Alte Adresse bleibt als Alias erhalten (optional) + +## 🤝 Beitragen + +Beiträge sind willkommen! Bitte beachten Sie: + +1. Forken Sie das Repository +2. Erstellen Sie einen Feature-Branch (`git checkout -b feature/AmazingFeature`) +3. Committen Sie Ihre Änderungen (`git commit -m 'Add some AmazingFeature'`) +4. Pushen Sie den Branch (`git push origin feature/AmazingFeature`) +5. Öffnen Sie einen Pull Request + +## 📄 Lizenz + +Dieses Projekt steht unter der MIT-Lizenz - siehe LICENSE-Datei für Details. + +## 👥 Autoren + +- **PS-easyIT** - *Initial work* + +## 🙏 Danksagungen + +- Microsoft Active Directory Team für das PowerShell-Modul +- WPF-Community für UI-Best-Practices +- Alle Tester und Beitragenden + +## 📞 Support + +Bei Fragen oder Problemen: +- Öffnen Sie ein Issue im GitHub-Repository +- Konsultieren Sie die Microsoft-Dokumentation zu ProxyAddresses + +## 🔄 Changelog + +### Version 1.0.0 (2025-12-08) +- Initial Release +- WPF-GUI Implementation +- Basis-Funktionalität für ProxyAddress-Verwaltung +- Benutzersuche und -auswahl +- Add/Remove/Set Primary Funktionen +- Format-Validierung +- Status- und Fehlermeldungen + +## 🗺️ Roadmap + +Geplante Features für zukünftige Versionen: + +- [ ] Export/Import von ProxyAddresses (CSV) +- [ ] Batch-Operationen für mehrere Benutzer +- [ ] Logging-Funktionalität +- [ ] Konfigurationsdatei für Standardwerte +- [ ] Domain-Filter +- [ ] Erweiterte Suchoptionen +- [ ] ProxyAddress-Vorlagen +- [ ] Undo/Redo-Funktionalität +- [ ] Dark Mode +- [ ] Mehrsprachigkeit (EN/DE) \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..ce8b6b2 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,250 @@ +# Security Considerations for easyEXCH ProxyAddress Manager + +## Security Review Summary + +This document outlines the security considerations and best practices implemented in the easyEXCH ProxyAddress Manager. + +### ✅ Security Measures Implemented + +#### 1. Input Validation +- **Email Format Validation**: Uses .NET `System.Net.Mail.MailAddress` class for robust email validation +- **User Input Sanitization**: All user inputs are validated before processing +- **AD Query Filtering**: Uses parameterized AD queries to prevent injection attacks +- **Result Limitation**: AD queries limited to 50 results to prevent resource exhaustion + +#### 2. Active Directory Security +- **Least Privilege Principle**: + - Only requires read permissions on User objects + - Only requires write permissions on ProxyAddresses attribute + - Does not require domain admin privileges +- **Credential Management**: Uses current Windows credentials (no credential storage) +- **Module Verification**: Verifies ActiveDirectory module is installed before proceeding + +#### 3. User Confirmations +- **Destructive Operations**: Confirmation dialogs for: + - Removing ProxyAddresses + - Changing primary SMTP address (with additional warning) + - Setting new primary address +- **Clear Warnings**: Explicit warnings when removing primary SMTP addresses + +#### 4. Error Handling +- **Try-Catch Blocks**: All AD operations wrapped in error handling +- **User-Friendly Messages**: Errors displayed with context +- **Logging**: Status updates for all operations +- **Graceful Degradation**: Application continues after non-critical errors + +#### 5. WPF Security +- **Proper Threading**: Uses WPF Dispatcher instead of DoEvents to prevent reentrancy issues +- **No External Resources**: All UI resources defined locally (no external XAML loading) +- **Type Safety**: Strongly typed .NET assemblies + +### 🔒 Security Best Practices for Users + +#### Required Permissions +```powershell +# Minimum AD permissions needed: +# - Read: User objects +# - Write: ProxyAddresses attribute only + +# Recommended: Create a dedicated AD group with these permissions +# Do NOT use Domain Admin accounts for daily operations +``` + +#### Execution Policy +```powershell +# Set appropriate execution policy +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +# Verify script signature (if organization uses code signing) +Get-AuthenticodeSignature .\easyEXCH-ProxyMailAddresses.ps1 +``` + +#### Network Security +- **Domain Authentication**: Uses Kerberos authentication +- **Encrypted Communication**: LDAP over SSL (LDAPS) recommended +- **Firewall Rules**: Ensure proper AD ports are accessible + - LDAP: 389/tcp (or 636/tcp for LDAPS) + - Kerberos: 88/tcp, 88/udp + +### ⚠️ Known Limitations + +#### 1. Credential Storage +- **Current Limitation**: Uses current Windows user credentials only +- **Mitigation**: Run as user with appropriate AD permissions +- **Future Enhancement**: Could add support for alternate credentials + +#### 2. Audit Logging +- **Current Limitation**: No centralized audit log +- **Mitigation**: AD tracks all ProxyAddress changes in event logs +- **Monitoring**: Use AD audit logs for compliance: + ```powershell + # View AD changes (requires appropriate permissions) + Get-WinEvent -LogName "Security" -FilterXPath "*[System[EventID=5136]]" | + Where-Object {$_.Message -like "*proxyAddresses*"} + ``` + +#### 3. Concurrent Modifications +- **Current Limitation**: No locking mechanism for simultaneous edits +- **Mitigation**: Refresh button updates data before operations +- **Best Practice**: Avoid multiple users editing same account simultaneously + +### 🛡️ Security Recommendations + +#### For Administrators + +1. **Delegation Model** + ``` + - Create AD security group: "ProxyAddress-Managers" + - Delegate write permissions on ProxyAddresses only + - Add helpdesk staff to this group + - Monitor group membership regularly + ``` + +2. **Audit Configuration** + ```powershell + # Enable auditing on User objects + # 1. Group Policy: Computer Configuration → Windows Settings → + # Security Settings → Advanced Audit Policy Configuration + # 2. Enable: "Audit Directory Service Changes" + ``` + +3. **Baseline Configuration** + - Document standard ProxyAddress formats + - Create templates for different user types + - Define approval process for primary SMTP changes + +4. **Regular Reviews** + - Quarterly review of ProxyAddress configurations + - Audit unusual ProxyAddress patterns + - Monitor for unauthorized changes + +#### For Users + +1. **Before Making Changes** + - Document current configuration (screenshot) + - Verify user identity + - Check for existing change requests + - Test with non-production users first + +2. **During Operations** + - Use Refresh button before modifications + - Verify changes immediately after + - Monitor ADSync status + - Check MS365 propagation + +3. **After Changes** + - Verify email delivery to new addresses + - Confirm old addresses still work (if kept as aliases) + - Document changes in ticketing system + - Monitor for issues in first 24 hours + +### 🔍 Security Testing Performed + +#### Input Validation Tests +- ✅ Email format validation (valid/invalid formats) +- ✅ Long input strings (buffer overflow prevention) +- ✅ Special characters in search terms +- ✅ Empty/null inputs +- ✅ Unicode characters in addresses + +#### AD Operation Tests +- ✅ Invalid user identifiers +- ✅ Non-existent attributes +- ✅ Duplicate ProxyAddress detection +- ✅ Permission denied scenarios +- ✅ Connection failures + +#### UI Security Tests +- ✅ WPF threading model (no reentrancy issues) +- ✅ Memory management (no leaks) +- ✅ Error message information disclosure +- ✅ Confirmation dialogs functionality + +### 🚨 Incident Response + +If suspicious activity is detected: + +1. **Immediate Actions** + ```powershell + # Review recent ProxyAddress changes + Get-ADUser -Filter * -Properties ProxyAddresses, whenChanged | + Where-Object {$_.whenChanged -gt (Get-Date).AddHours(-24)} | + Select-Object SamAccountName, ProxyAddresses, whenChanged + ``` + +2. **Investigation** + - Check Windows Security Event Logs + - Review AD Replication logs + - Verify ADSync operations + - Check MS365 audit logs + +3. **Recovery** + - Restore from AD backup if necessary + - Document timeline of changes + - Implement additional controls + - Review and update permissions + +### 📋 Compliance Considerations + +#### GDPR / Data Protection +- **Personal Data**: Email addresses are personal data +- **Processing**: Document legitimate interest for ProxyAddress management +- **Retention**: Follow organization's data retention policies +- **Access**: Limit access to authorized personnel only + +#### SOX / Financial Controls +- **Segregation of Duties**: Separate approval and execution roles +- **Audit Trail**: Maintain logs of all changes +- **Change Management**: Document and approve changes + +#### ISO 27001 +- **Access Control**: Implement least privilege principle +- **Asset Management**: Document tool as IT asset +- **Change Management**: Follow change control procedures + +### 🔄 Security Update Process + +1. **Regular Reviews**: Monthly security assessment +2. **Patch Management**: Update PowerShell and .NET Framework +3. **Module Updates**: Keep ActiveDirectory module current +4. **Vulnerability Scanning**: Regular security scans +5. **Code Reviews**: Review any custom modifications + +### 📞 Security Contact + +For security concerns or to report vulnerabilities: +- **GitHub Issues**: Use "Security" label (for non-critical issues) +- **Private Disclosure**: Contact repository maintainer directly +- **Response Time**: Aim for 48-hour acknowledgment + +### 📝 Security Changelog + +#### Version 1.0.0 (2025-12-08) +- ✅ Implemented email validation using .NET MailAddress +- ✅ Added confirmation dialogs for destructive operations +- ✅ Implemented proper WPF threading model +- ✅ Optimized AD queries with ResultSetSize +- ✅ Added comprehensive error handling +- ✅ Removed XAML inline event handlers +- ✅ Implemented status logging +- ✅ Added duplicate detection +- ✅ Created security documentation + +### 🎯 Future Security Enhancements + +Planned for future versions: +- [ ] Digital signature for PowerShell script +- [ ] Enhanced audit logging to file +- [ ] Support for Read-Only mode +- [ ] Integration with SIEM systems +- [ ] Multi-factor authentication support +- [ ] Rate limiting for AD queries +- [ ] Rollback functionality +- [ ] Backup before modification +- [ ] Change approval workflow + +--- + +**Last Updated**: 2025-12-08 +**Version**: 1.0.0 +**Reviewed By**: Copilot Security Review diff --git a/easyEXCH-ProxyMailAddresses.ps1 b/easyEXCH-ProxyMailAddresses.ps1 new file mode 100644 index 0000000..9e225f3 --- /dev/null +++ b/easyEXCH-ProxyMailAddresses.ps1 @@ -0,0 +1,664 @@ +#Requires -Version 5.1 +#Requires -Modules ActiveDirectory + +<# +.SYNOPSIS + easyEXCH ProxyAddress Manager - Manage ProxyMailAddresses in Active Directory +.DESCRIPTION + A PowerShell-based tool with modern WPF GUI to manage ProxyMailAddresses in Active Directory. + Designed for environments without a local Exchange Server but using MS365 ADSync. +.NOTES + Author: PS-easyIT + Version: 1.0.0 + Date: 2025-12-08 +#> + +[CmdletBinding()] +param() + +# Add required assemblies +Add-Type -AssemblyName PresentationFramework +Add-Type -AssemblyName PresentationCore +Add-Type -AssemblyName WindowsBase + +# Import Active Directory module +if (-not (Get-Module -ListAvailable -Name ActiveDirectory)) { + [System.Windows.MessageBox]::Show("Active Directory module is not installed. Please install RSAT tools.", "Missing Module", "OK", "Error") + exit +} + +Import-Module ActiveDirectory + +#region XAML Definition +$xaml = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +