Prerequisites:
Powershell App Deployment Tool - Releases · PSAppDeployToolkit/PSAppDeployToolkit · GitHub
First download the packages above and extract the zip files:
Setting up files:
- Navigate to "PSAppDeployToolkit_v3.8.3\Toolkit" and copy everything in that folder to a central location. For example, I copied the contents to C:\Users\%MyDirectory%\Documents\OfficePurge" .
- In the extracted "Office-IT-Pro-Deployment-Scripts-master"folder, go to "Office-IT-Pro-Deployment-Scripts-master\Office-ProPlus-Deployment\Remove-PreviousOfficeInstalls" directory and copy all contents to "C:\Users\%YourDirectory%\Documents\OfficePurge\Files" directory.
- Go to your OfficePurge folder and compress/zip all contents in that directory. The zip file will be uploaded to Kace as a dependency
Kace setup:
- In Kace, go to Scripting | Scripts and create a new script (Online Kscript or Offline KScript).
- Fill out the required information up to your Task. Please remember to have this script ran as a SYSTEM user
- Add the Zip file as a New Dependency
- Create a new task. In the "On Success section, Select Add | Launch a Program.
Directory Field: $(KACE_DEPENDENCY_DIR)
File: Deploy-Application.exe
Parameters: $(KACE_DEPENDENCY_DIR)\Files\Remove-PreviousOfficeInstalls.ps1 -Remove2016Installs $true
NOTE: if you are removing any other office products, change your parameters to the version of office you'd like to remove. Also, more details are available on the github link provided above
Save your script and test by deploying to a test machine for results.
Note: Many may ask why not call powershell.exe from Kace to execute the Powershell script. In Kace when you call powershell.exe it runs the 32bit version of Powershell. Regardless if you force Kace to use powershell in the "C:\Windows\System32\WindowsPowerShell\v1.0" directory it still uses the 32bit powershell.exe on a 64bit system. This was causing results not intended. So a solution was to use the PSADT toolkit and use the "Deploy-Application.exe" to call the powershell script. This triggered the 64bit Powershell.exe and the commands were executed as intended. This took me a week to figure out not realizing Kace was the issue. This should be helpful for others that may come across needing to Run 64bit Powershell and need to remove Office from their environment.
I've download the source zip file, but I cannot find the folder "Office-IT-Pro-Deployment-Scripts-master\Office-ProPlus-Deployment\Remove-PreviousOfficeInstalls".
I want to uninstall Office 365 32bit and install Office 365 64bit
Can you support me?
Thanks in advance
Angelo - testa19 3 years ago