# -------------------------------------------------------------------- <# # # Outlook-New-Entfernen.ps1 # # Outlook-New: # . Vom Rechner entfernen # . Bei allen Benutzern entfernen # . Automatische Umstellung deaktivieren # # Parameter : - # # 2025-03-04/Rc : Initiale Version # 2025-03-08/Rc : Entfernen von Windows-Mail integriert # #> # -------------------------------------------------------------------- # ----- Paket vom Rechner entfernen: Kuenftige Benutzer koennen kein Outlook-New mehr erhalten ----- # https://learn.microsoft.com/de-de/microsoft-365-apps/outlook/get-started/control-install # https://administrator.de/knowledge/zuverlaessiger-remove-appxprovisionedpackage-ausfuehren-in-w10-1803-389143.html # https://www.reddit.com/r/PowerShell/comments/1bprao8/trying_to_use_removeappxprovisionedpackage_always/ $PackageName = "Microsoft.OutlookForWindows" Get-AppxProvisionedPackage -Online | Where-Object -Property PackageName -match $PackageName | Remove-AppxProvisionedPackage -Online # ----- Outlook-New bei allen definierten Benutzern entfernen # https://answers.microsoft.com/en-us/outlook_com/forum/all/how-to-remove-outlook-new-app-for-all-users-also/ae321ce0-fd3a-4a5c-b0fb-28d75281fb5a Get-AppxPackage -AllUsers | Where-Object {$_.Name -Like $PackageName} | Remove-AppxPackage -AllUsers -ErrorAction Continue # ----- Deaktivierung der automatischen Umstellung auf Microsoft Outlook New ----- # https://learn.microsoft.com/de-de/microsoft-365-apps/outlook/get-started/control-install) # https://apps.datev.de/help-center/documents/1037821 $RegistryPath = "HKCU:\Software\Policies\Microsoft\office\16.0\Outlook\Preferences" $Name = "NewOutlookMigrationUserSetting" $Value = "0" $PropertyType = "DWORD" # Create the key if it does not exist If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null } # Now set the value New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType $PropertyTyp -Force # Zweite Policy (https://learn.microsoft.com/en-us/microsoft-365-apps/outlook/manage/admin-controlled-migration-policy): $RegistryPath = "HKCU:\Software\Policies\Microsoft\office\16.0\Outlook\Options\General" $Name = "DoNewOutlookAutoMigration" $Value = "0" $PropertyType = "DWORD" # Create the key if it does not exist If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null } # Now set the value New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType $PropertyTyp -Force # Policy, um automatisches Öffnen von Microsoft Outlook new beim Starten vom Microsoft Outlook zu deaktivieren (https://support.microsoft.com/en-us/office/toggle-out-of-the-new-outlook-for-windows-preview-ec102b39-5727-418e-ae1f-a1805434640c): $RegistryPath = "HKCU:\Software\Policies\Microsoft\office\16.0\Outlook\Preferences" $Name = "UseNewOutlook" $Value = "0" $PropertyType = "DWORD" # Create the key if it does not exist If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null } # Now set the value New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType $PropertyTyp -Force # Policy zur Intervallsteuerung zwischen Migrationsversuchen (https://learn.microsoft.com/en-us/microsoft-365-apps/outlook/manage/admin-controlled-migration-policy): $RegistryPath = "HKCU:\Software\Policies\Microsoft\Office\16.0\Outlook\Options\General" $Name = "NewOutlookAutoMigrationRetryIntervals" $Value = "0" $PropertyType = "DWORD" # Create the key if it does not exist If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null } # Now set the value New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType $PropertyTyp -Force # Policy, um Schalter „Neues Outlook testen” auszublenden (https://learn.microsoft.co; m/de-de/exchange/clients-and-mobile-in-exchange-online/outlook-on-the-web/enable-disable-employee-access-new-outlook): $RegistryPath = "HKCU:\Software\Policies\Microsoft\office\16.0\Outlook\Options\General" $Name = "HideNewOutlookToggle" $Value = "1" $PropertyType = "DWORD" # Create the key if it does not exist If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null } # Now set the value New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType $PropertyTyp -Force # ----- Windows-Mail entfernen ----- # https://www.reddit.com/r/sysadmin/comments/bxznso/uninstall_windows_10_mail_app_for_all_users/?tl=de Write-Output "Windows 10 Mail Appx-Paket entfernen" if(Get-AppxPackage -Name Microsoft.windowscommunicationsapps -AllUsers){ Get-AppxPackage -Name Microsoft.windowscommunicationsapps -AllUsers | Remove-AppxPackage -AllUsers -Verbose -ErrorAction Continue } else { Write-Output "Mail-App ist für keinen Benutzer installiert" } if(Get-ProvisionedAppxPackage -Online | Where-Object {$_.DisplayName -match "Microsoft.windowscommunicationsapps"}){ Get-ProvisionedAppxPackage -Online | Where-Object {$_.DisplayName -match "Microsoft.windowscommunicationsapps"} | Remove-AppxProvisionedPackage -Online -AllUsers -Verbose -ErrorAction Continue } else { Write-Output "Mail-App ist nicht für das System installiert" }