PowershellCall elevated - New Outlook entfernen

Antworten
feltel
Beiträge: 280
Registriert: 09 Dez 2014, 07:22

PowershellCall elevated - New Outlook entfernen

Beitrag von feltel »

Ich versuche gerade der Verteilung des "New Outlook" mittels OPSI Herr zu werden. Ist wirklich "toll", das solche Sachen im Rahmen eines Patchdays ausgerollt werden. In einem Paket habe ich hierzu einen PowershellCall eingebaut, aber der läuft offenbar nicht mit Admin-Privilegien. Übersehe ich was? Die anderen Sachen die ich mit Powershell in OPSI mache laufen ohne Mucken.

Code: Alles auswählen

PowershellCall("Get-AppxPackage -AllUsers | Where-Object {$_.Name -Like '*OutlookForWindows*'} | Remove-AppxPackage -AllUsers")
Im Log steht dann:

Code: Alles auswählen

(535)     [5] [2025-02-19 08:24:40.895] [docemus-branding] PowershellCall: Get-AppxPackage -AllUsers | Where-Object {$_.Name -Like '*OutlookForWindows*'} | Remove-AppxPackage -AllUsers (mode: sysnative)
(536)     [6] [2025-02-19 08:24:43.953] [docemus-branding] ExitCode 1
(537)     [7] [2025-02-19 08:24:43.957] [docemus-branding] output:
(538)     [7] [2025-02-19 08:24:43.957] [docemus-branding] --------------
(539)     [7] [2025-02-19 08:24:43.957] [docemus-branding] Remove-AppxPackage : Zugriff verweigert
(540)     [7] [2025-02-19 08:24:43.957] [docemus-branding] 
(541)     [7] [2025-02-19 08:24:43.957] [docemus-branding] Der Bereitstellungsvorgang "DeStage" mit Zielvolume "C:" für das Paket
(542)     [7] [2025-02-19 08:24:43.957] [docemus-branding] "Microsoft.OutlookForWindows_1.2025.205.100_x64__8wekyb3d8bbwe" von " " ist mit dem Fehler 0x80070005 fehlgeschlagen.
(543)     [7] [2025-02-19 08:24:43.957] [docemus-branding] Weitere Informationen zum Diagnostizieren von Problemen bei der Bereitstellung von Apps finden Sie unter
(544)     [7] [2025-02-19 08:24:43.957] [docemus-branding] "http://go.microsoft.com/fwlink/?LinkId=235160".
(545)     [7] [2025-02-19 08:24:43.957] [docemus-branding] In C:\opsi.org\tmp\_opsiscript_Ddb78SY3b7.ps1:2 Zeichen:82
(546)     [7] [2025-02-19 08:24:43.957] [docemus-branding] + ...  {$_.Name -Like '*OutlookForWindows*'} | Remove-AppxPackage -AllUsers
(547)     [7] [2025-02-19 08:24:43.957] [docemus-branding] +                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(548)     [7] [2025-02-19 08:24:43.957] [docemus-branding]     + CategoryInfo          : NotSpecified: (:) [Remove-AppxPackage], UnauthorizedAccessException
(549)     [7] [2025-02-19 08:24:43.957] [docemus-branding]     + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Windows.Appx.PackageManager.Commands.Remove
(550)     [7] [2025-02-19 08:24:43.957] [docemus-branding]    AppxPackageCommand
(551)     [7] [2025-02-19 08:24:43.957] [docemus-branding] 
(552)     [5] [2025-02-19 08:24:43.959] [docemus-branding] Execution of: Registry_Block_NewOutlook /sysnative
(553)     [7] [2025-02-19 08:24:43.959] [docemus-branding] Registry started without redirection (64 Bit)
(554)     [7] [2025-02-19 08:24:43.959] [docemus-branding] Key is: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe
(555)     [6] [2025-02-19 08:24:43.959] [docemus-branding] Registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe] opened
(556)     [6] [2025-02-19 08:24:43.959] [docemus-branding] Variable "BlockedOobeUpdaters"  is keeping its value "["MS_Outlook"]"
(557)     [6] [2025-02-19 08:24:43.959] [docemus-branding] Key closed
feltel
Beiträge: 280
Registriert: 09 Dez 2014, 07:22

Re: PowershellCall elevated - New Outlook entfernen

Beitrag von feltel »

Ich antworte mir mal selber. Das schein kein Problem zu sein, ob PowershellCall elevated läuft oder nicht. Das ist wohl eher so als das Remove-AppxPackage -AllUsers nicht wirklich zuverlässig ist. Ich habe mich mal an https://www.dzhang.com/blog/2024/03/17/ ... windows-10 orientiert und die Funktion umgestrickt. Damit läuft das und das New Outlook ist auf dem Testrechner deinstalliert. Hoffentlich muss man das jetzt nicht jeden Patchday machen.
Antworten