From 33707bdb44c9474d55c590ab87177780a754bf65 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Fri, 3 Apr 2026 10:13:56 +0200 Subject: [PATCH] Simplify add-in registration to browser sideload only Remove Exchange PowerShell option. Outlook add-ins are registered per Microsoft 365 account via browser sideload. Each user must add the add-in once - it then works on all their devices. Co-Authored-By: Claude Opus 4.6 (1M context) --- installer/setup.ps1 | 135 +++++++++------------------------------- installer/uninstall.ps1 | 23 ++----- 2 files changed, 34 insertions(+), 124 deletions(-) diff --git a/installer/setup.ps1 b/installer/setup.ps1 index c4ee9e4d..b7e7ca39 100644 --- a/installer/setup.ps1 +++ b/installer/setup.ps1 @@ -422,105 +422,34 @@ New-Item -ItemType Directory -Path $manifestDir -Force | Out-Null Copy-Item -Path (Join-Path $InstallDir "manifest.xml") -Destination $manifestDir -Force $manifestFile = Join-Path $manifestDir "manifest.xml" -# Outlook Add-ins koennen NICHT per Registry/Shared Folder Catalog registriert werden. -# Das funktioniert nur fuer Word/Excel/PowerPoint. -# Fuer Outlook gibt es zwei Wege: -# 1. Exchange Online PowerShell (New-App) - fuer Organisationen mit Exchange -# 2. Manuell ueber Outlook Web App (OWA) - fuer alle +# Outlook Add-ins werden pro Benutzer ueber den Browser registriert. +# Das Add-in wird am Microsoft 365 Konto des Benutzers gespeichert, +# nicht am Computer. Auf einem Terminal Server muss jeder Benutzer +# das Add-in einmalig selbst hinzufuegen. -$registeredViaExchange = $false - -Write-Host " Outlook Add-ins muessen ueber Exchange oder manuell registriert werden." -ForegroundColor Gray +Write-Host " Das Add-in muss pro Benutzer einmalig in Outlook" -ForegroundColor White +Write-Host " hinzugefuegt werden. Es wird am Microsoft 365 Konto" -ForegroundColor White +Write-Host " gespeichert und ist dann auf allen Geraeten verfuegbar." -ForegroundColor White +Write-Host "" +Write-Host " So geht's:" -ForegroundColor Cyan +Write-Host " 1. Im Browser oeffnen: https://aka.ms/olksideload" -ForegroundColor White +Write-Host " 2. Mit dem eigenen Microsoft 365 Konto anmelden" -ForegroundColor White +Write-Host " 3. 'Meine Add-Ins' -> 'Benutzerdefinierte Add-Ins'" -ForegroundColor White +Write-Host " 4. 'Benutzerdefiniertes Add-In hinzufuegen' -> 'Aus Datei'" -ForegroundColor White +Write-Host " 5. Diese Datei waehlen:" -ForegroundColor White +Write-Host " $manifestFile" -ForegroundColor Yellow +Write-Host "" +Write-Host " Alternativ direkt in Outlook:" -ForegroundColor Cyan +Write-Host " Classic: Datei -> Info -> 'Add-Ins verwalten'" -ForegroundColor White +Write-Host " Neu: Einstellungen -> Add-Ins verwalten" -ForegroundColor White Write-Host "" -# Variante 1: Exchange Online PowerShell versuchen -$tryExchange = Read-Host "Haben Sie Exchange Online und moechten das Add-in per Exchange bereitstellen? (j/n)" - -if ($tryExchange -eq "j") { - Write-Step "Pruefe Exchange Online PowerShell Modul ..." - - # Modul pruefen/installieren - $exModule = Get-Module -ListAvailable -Name "ExchangeOnlineManagement" -ErrorAction SilentlyContinue - if (-not $exModule) { - Write-Warn "ExchangeOnlineManagement Modul nicht gefunden." - $installModule = Read-Host "Modul jetzt installieren? (j/n)" - if ($installModule -eq "j") { - try { - Install-Module -Name ExchangeOnlineManagement -Force -Scope CurrentUser - Write-Step "Modul installiert." - } catch { - Write-Err "Modul-Installation fehlgeschlagen: $_" - } - } - } - - $exModule = Get-Module -ListAvailable -Name "ExchangeOnlineManagement" -ErrorAction SilentlyContinue - if ($exModule) { - try { - Import-Module ExchangeOnlineManagement - - Write-Host "" - Write-Host " Es oeffnet sich ein Anmeldefenster fuer Exchange Online." -ForegroundColor Gray - Write-Host " Bitte mit einem Exchange-Administrator-Konto anmelden." -ForegroundColor Gray - Write-Host "" - - Connect-ExchangeOnline -ShowBanner:$false - - $manifestBytes = [System.IO.File]::ReadAllBytes($manifestFile) - - # Als Organisations-App bereitstellen (fuer alle Benutzer) - $orgApp = Read-Host "Fuer alle Benutzer der Organisation bereitstellen? (j/n)" - if ($orgApp -eq "j") { - New-App -OrganizationApp -FileData $manifestBytes -DefaultStateForUser Enabled | Out-Null - Write-Step "Add-in fuer alle Benutzer der Organisation bereitgestellt!" - } else { - # Nur fuer bestimmte Mailbox - $mailbox = Read-Host "E-Mail-Adresse des Benutzers" - New-App -Mailbox $mailbox -FileData $manifestBytes | Out-Null - Write-Step "Add-in fuer $mailbox bereitgestellt!" - } - - $registeredViaExchange = $true - Disconnect-ExchangeOnline -Confirm:$false -ErrorAction SilentlyContinue - - } catch { - Write-Err "Exchange-Registrierung fehlgeschlagen: $_" - Write-Warn "Das Add-in kann stattdessen manuell hinzugefuegt werden (siehe unten)." - } - } -} - -# Variante 2: Manuelle Registrierung (Fallback / kein Exchange) -if (-not $registeredViaExchange) { - Write-Host "" - Write-Header "Add-in manuell in Outlook registrieren" - Write-Host " Das Add-in muss in Outlook manuell hinzugefuegt werden." -ForegroundColor White - Write-Host " Dies gilt fuer Outlook Classic UND das neue Outlook." -ForegroundColor White - Write-Host "" - Write-Host " Variante A - Ueber Outlook Web App:" -ForegroundColor Cyan - Write-Host " 1. Im Browser oeffnen: https://aka.ms/olksideload" -ForegroundColor White - Write-Host " 2. 'Meine Add-Ins' -> 'Benutzerdefinierte Add-Ins'" -ForegroundColor White - Write-Host " 3. 'Benutzerdefiniertes Add-In hinzufuegen' -> 'Aus Datei hinzufuegen'" -ForegroundColor White - Write-Host " 4. Datei waehlen: $manifestFile" -ForegroundColor Yellow - Write-Host "" - Write-Host " Variante B - Direkt in Outlook Classic:" -ForegroundColor Cyan - Write-Host " 1. Outlook Classic oeffnen" -ForegroundColor White - Write-Host " 2. Datei -> Info -> 'Add-Ins verwalten' (oeffnet sich im Browser)" -ForegroundColor White - Write-Host " 3. Weiter wie bei Variante A ab Schritt 2" -ForegroundColor White - Write-Host "" - Write-Host " Variante C - Direkt im neuen Outlook:" -ForegroundColor Cyan - Write-Host " 1. Neues Outlook oeffnen" -ForegroundColor White - Write-Host " 2. Einstellungen (Zahnrad) -> Add-Ins verwalten" -ForegroundColor White - Write-Host " 3. 'Benutzerdefinierte Add-Ins' -> 'Aus Datei hinzufuegen'" -ForegroundColor White - Write-Host " 4. Datei waehlen: $manifestFile" -ForegroundColor Yellow - Write-Host "" - - $openBrowser = Read-Host "Sideload-Seite jetzt im Browser oeffnen? (j/n)" - if ($openBrowser -eq "j") { - Start-Process "https://aka.ms/olksideload" - Write-Step "Browser geoeffnet. Bitte Add-in wie oben beschrieben hinzufuegen." - Write-Host " Manifest-Datei: $manifestFile" -ForegroundColor Yellow - } +$openBrowser = Read-Host "Sideload-Seite jetzt im Browser oeffnen? (j/n)" +if ($openBrowser -eq "j") { + Start-Process "https://aka.ms/olksideload" + Write-Step "Browser geoeffnet." + Write-Host " Bitte Add-in wie oben beschrieben hinzufuegen." -ForegroundColor White + Write-Host " Manifest-Datei: $manifestFile" -ForegroundColor Yellow } # ============================================================ @@ -533,10 +462,10 @@ $installInfo = @{ taskName = $taskName installedAt = (Get-Date).ToString("o") manifestDir = $manifestDir + manifestFile = $manifestFile manifestUrl = "https://localhost:$localPort" caThumbprint = $caCert.Thumbprint localhostThumbprint = $localhostCert.Thumbprint - registeredViaExchange = $registeredViaExchange } $installInfo | ConvertTo-Json | Set-Content (Join-Path $InstallDir "install-info.json") -Encoding UTF8 @@ -550,15 +479,9 @@ Write-Host " Installationsverzeichnis: $InstallDir" -ForegroundColor White Write-Host " Lokaler Server: https://localhost:$localPort" -ForegroundColor White Write-Host " Manifest: $manifestFile" -ForegroundColor White Write-Host "" - -if ($registeredViaExchange) { - Write-Host " Outlook Add-in wurde per Exchange bereitgestellt." -ForegroundColor Green - Write-Host " Es kann einige Minuten dauern bis es in Outlook erscheint." -ForegroundColor Green -} else { - Write-Host " [!] Add-in muss noch manuell in Outlook hinzugefuegt werden!" -ForegroundColor Yellow - Write-Host " Manifest-Datei: $manifestFile" -ForegroundColor Yellow - Write-Host " Oder im Browser: https://aka.ms/olksideload" -ForegroundColor Yellow -} +Write-Host " [!] Jeder Benutzer muss das Add-in einmalig in Outlook" -ForegroundColor Yellow +Write-Host " hinzufuegen: https://aka.ms/olksideload" -ForegroundColor Yellow +Write-Host " Manifest-Datei: $manifestFile" -ForegroundColor Yellow Write-Host "" Write-Host " Naechster Schritt: Im Add-in ein Sync-Profil mit den" -ForegroundColor White diff --git a/installer/uninstall.ps1 b/installer/uninstall.ps1 index 9f9a94db..30087b0e 100644 --- a/installer/uninstall.ps1 +++ b/installer/uninstall.ps1 @@ -101,24 +101,11 @@ if (Test-Path $certInfoPath) { Write-Header "Schritt 3: Outlook Add-in Registrierung" -# Pruefen ob per Exchange registriert -$installInfoPath = Join-Path $InstallDir "install-info.json" -$registeredViaExchange = $false -if (Test-Path $installInfoPath) { - $installInfo = Get-Content $installInfoPath -Raw | ConvertFrom-Json - $registeredViaExchange = $installInfo.registeredViaExchange -eq $true -} - -if ($registeredViaExchange) { - Write-Warn "Das Add-in wurde per Exchange bereitgestellt." - Write-Host " Um es dort zu entfernen:" -ForegroundColor Gray - Write-Host " 1. Exchange Online PowerShell: Get-App | Remove-App" -ForegroundColor Gray - Write-Host " 2. Oder im Microsoft 365 Admin Center" -ForegroundColor Gray -} else { - Write-Step "Das Add-in wurde manuell in Outlook hinzugefuegt." - Write-Host " Bitte manuell entfernen:" -ForegroundColor Gray - Write-Host " Outlook -> Add-Ins verwalten -> Add-In entfernen" -ForegroundColor Gray -} +Write-Warn "Das Add-in ist pro Benutzer am Microsoft 365 Konto registriert." +Write-Host " Jeder Benutzer muss es selbst in Outlook entfernen:" -ForegroundColor Gray +Write-Host " 1. https://aka.ms/olksideload oeffnen" -ForegroundColor Gray +Write-Host " 2. Unter 'Meine Add-Ins' das Add-in entfernen" -ForegroundColor Gray +Write-Host " Oder in Outlook: Add-Ins verwalten -> Add-In entfernen" -ForegroundColor Gray # ============================================================ # Schritt 4: Firewall-Regel entfernen