Hi, @FCK
From your description, I know you want to uninstall Office 2019 and install MS365.
To uninstall Office 2019, here is a PowerShell script you can refer to.
$OfficePath = "C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe"
if (Test-Path $OfficePath) {
Start-Process -FilePath $OfficePath -ArgumentList "/update user displaylevel=false forceappshutdown=true updatetoversion=16.0.12527.20278" -Wait -NoNewWindow
Start-Sleep -Seconds 10
}
Write-Output "Attempting Office uninstall..."
$OfficeScrub = "C:\ProgramData\Microsoft\Office\OfficeScrub.cmd"
Invoke-Expression -Command "$OfficeScrub ALL /quiet /norestart"
Start-Sleep -Seconds 10
Restart-Computer -Force
You can test on your targeted device and upload it into Intune, then deploy it.
https://learn.microsoft.com/en-us/mem/intune-service/apps/intune-management-extension
For installing MS365, please first uninstall it and you can use the following xml to replace the same place in your xml and re-deploy it.
<Configuration>
<Display Level="None" AcceptEULA="TRUE"/>
<Add OfficeClientEdition="64" Channel="Current">
<Product ID="O365BusinessRetail">
<Language ID="de-de"/>
<ExcludeApp ID="Groove"/>
<ExcludeApp ID="Lync"/>
</Product>
</Add>
<Property Name="SharedComputerLicensing" Value="0"/>
<Property Name="DeviceBasedLicensing" Value="0"/>
<Property Name="AUTOACTIVATE" Value="1"/>
<Updates Enabled="TRUE"/>
<RemoveMSI/>
</Configuration>
Also, here is a link to troubleshoot error message.
https://techuisitive.com/intune-win32-app-deployment-failed-with-error-code-0x80070643/
Non-official, just for reference.
Hope it can help you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.