Trying to Remove Office products smoothly with "Remove-PreviousOfficeInstalls" Powershell script
I am fairly new to KACE scripting and I am trying to use the scripts located @https://github.com/OfficeDev/Office-IT-Pro-Deployment-Scripts/tree/master/Office-ProPlus-Deployment/Remove-PreviousOfficeInstalls,
to remove all versions of office and reinstall the latest version. However my scripting is not giving me the desired results. I am trying to upload a zipped file (Office365_Removal2) to c:\windows\temp, then from there I am tring to unzip that file which has multiple Office removal files and then run the powershell command to start the script to remove All-Office versions. I am uploading Unzipping from C:\Windows\Temp, because I haven't had results trying it from the $(KACE_DEPENENCY_DIR). Plus I haven't seen success trying to unzip the file from the $(KACE_DEPENDENCY_DIR) either.The files get downloaded to the (C:\ProgramData\Quest\KACE\kbots_cache\packages\kbots\177) directory but I haven't been able to work from there. Here is what I have so far. Looking for some assistance if possible if anyone has used these tools to remove Office in their environment.
The Upload action attempts to upload a file from the client to the server, which I don't think is what you want to do. I'm pretty sure you want to get the zip file to the client, and that is done using a dependency. What are the contents of the zip file? When it is downloaded to the script's directory on the client, does it get automatically unzipped? What do those files look like? Are they all at the root of the dependency folder, or are they in a sub folder?
If the files get unzipped directly to the scripts folder, launching this command should work:
Arguments: /c powershell.exe -ExecutionPolicy bypass -file $(KACE_DEPENDENCY_VARIABLE)\Remove-PreviousOfficeInstalls.ps1
Remember that when using cmd.exe to run a command you need to use the /c parameter.
In answer to chucksteels questions, contents of the files
Here are the contents ofthe .zip file below. It is basically all the OffScrub files and the .power shellscripts. They end up in the kbots->Script# Directory and it is unzippedthere into a subfolder.
I debate about zippingthem in a file or just adding them as dependencies, because I think they willgo to the same place as shown. But after I get them there that’s when I am notable to get the correct parameters to get the scripts to remove the previousversions of Office or even the current version.