How to Uninstall Office using Kace/PSADT/GitHub(Office-IT-Pro-Deployment-Scripts)


Powershell App Deployment Tool - Releases · PSAppDeployToolkit/PSAppDeployToolkit · GitHub

Office Scripts - GitHub - OfficeDev/Office-IT-Pro-Deployment-Scripts: A collection of useful PowerShell scripts to make deploying Office 2016 and Office 365 ProPlus easier for IT Pros and administrators. If you have any feature requests or ideas for future scripts please add the idea to the issues list in this repository

First download the packages above and extract the zip files:

Setting up files:

  1. 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" .
  2. 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.
  3. 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. 


This post is locked
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ