How to Uninstall Office 365 Using ConfigMgr | SCCM
In this post I will show you how to uninstall Office 365 using ConfigMgr (SCCM). We will use the uninstall.xml file to uninstall the existing Office 365.
In one of my post, I covered on deploying Office 365 using SCCM. If you haven’t deployed Office 365 yet, that post will help you.
There are multiple methods to deploy Office 365 using ConfigMgr. However in every method we use a configuration.xml file.
Table of Contents
Office 365 Uninstall Command
When you create SCCM Office 365 installer, there is no uninstall command populated in deployment type. Seems like that’s by design and you have to specify the uninstall command manually.
You can uninstall or remove previous office versions while installing office 365. But what about uninstalling O365 ?. If you want to uninstall Office 365, you must do it manually. Most of all it is not feasible to uninstall Office 365 manually from each and every computer.
The question about how to uninstall Office 365 using ConfigMgr was asked in SCCM Forums and I now have an answer for that. Let’s look at the process of Office 365 removal from computers using SCCM.
How to Uninstall Office 365 Using ConfigMgr
I will split the steps to uninstall Office 365 using ConfigMgr into different steps. By this it should be easy to follow.
Step 1 – Create uninstall.xml file to uninstall Office365
The first step to uninstall O365 begins with creating a new uninstall.xml file. Create a new text file and rename it as uninstall.xml.
Edit the file with notepad and enter the below code. There are few things that you need to remember here. Ensure the OfficeClientEdition is correct, it’s either 64-bit or 32-bit. Since I have deployed 64-bit O365, my O365 client edition is 64.
Next, specify the correct product ID which is <Product ID=”O365ProPlusRetail”> in my case. If you are not sure about the product ID, you can always take a look at this info in Configuration.xml.
Some of the Product ID examples include.
- ID=”O365ProPlusRetail”
- ID=”VisioProRetail”
- ID=”ProjectProRetail”
If you have additional language ID’s specify them one below the other. For more info read the office deployment options.
<Configuration> <Remove OfficeClientEdition="64"> <Product ID="O365ProPlusRetail"> <Language ID="en-us"/> </Product> </Remove> <Display Level="None" AcceptEULA="TRUE"/> </Configuration>
Finally save the file and place this file along with O365 setup files in Sources folder.
Step 2 – Update the Uninstall Command under O365 Deployment Type
After you have the uninstall.xml file ready, go to Office 365 Deployment type properties. Click the programs tab and enter the Office 365 uninstall command.
You can use – setup.exe /configure uninstall.xml and click OK.
You must update the content because you have modified the deployment type. Right click Office 365 deployment type and click Update Content. This should send the updated content to all your distribution points.
Step 3 – Uninstall Office 365
On any computer that has Office 365 installed via software center, the uninstall option should be available. Click Uninstall button to remove Office 365.
Open the AppEnforce.log file to monitor the Office 365 uninstallation. Uninstall Office 365 using ConfigMgr completed successfully.
Log file output from the client computer for your reference.
+++ Starting Uninstall enforcement for App DT "Office 365 Default Deployment Type" ApplicationDeliveryType - ScopeId_33814590-F115-450C-96FE-8280E96BBAB2/DeploymentType_b3950316-23f7-4364-ba95-e5a6b62be403, Revision - 3, ContentPath - C:\Windows\ccmcache\a, Execution Context - System AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Performing detection of app deployment type Office 365 Default Deployment Type(ScopeId_33814590-F115-450C-96FE-8280E96BBAB2/DeploymentType_b3950316-23f7-4364-ba95-e5a6b62be403, revision 3) for user. AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) +++ Discovered application [AppDT Id: ScopeId_33814590-F115-450C-96FE-8280E96BBAB2/DeploymentType_b3950316-23f7-4364-ba95-e5a6b62be403, Revision: 3] AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) App enforcement environment: Context: Machine Command line: setup.exe /configure uninstall.xml Allow user interaction: No Content path: C:\Windows\ccmcache\a Working directory: AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Prepared working directory: C:\Windows\ccmcache\a AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Prepared command line: "C:\Windows\ccmcache\a\setup.exe" /configure uninstall.xml AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Executing Command line: "C:\Windows\ccmcache\a\setup.exe" /configure uninstall.xml with user context AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Working directory C:\Windows\ccmcache\a AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Post install behavior is BasedOnExitCode AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Waiting for process 7676 to finish. Timeout = 120 minutes. AppEnforce 12/21/2020 1:03:35 PM 7056 (0x1B90) Process 7676 terminated with exitcode: 0 AppEnforce 12/21/2020 1:04:32 PM 7056 (0x1B90) Looking for exit code 0 in exit codes table... AppEnforce 12/21/2020 1:04:32 PM 7056 (0x1B90) Matched exit code 0 to a Success entry in exit codes table. AppEnforce 12/21/2020 1:04:32 PM 7056 (0x1B90) Performing detection of app deployment type Office 365 Default Deployment Type(ScopeId_33814590-F115-450C-96FE-8280E96BBAB2/DeploymentType_b3950316-23f7-4364-ba95-e5a6b62be403, revision 3) for user. AppEnforce 12/21/2020 1:04:32 PM 7056 (0x1B90) +++ Application not discovered. [AppDT Id: ScopeId_33814590-F115-450C-96FE-8280E96BBAB2/DeploymentType_b3950316-23f7-4364-ba95-e5a6b62be403, Revision: 3] AppEnforce 12/21/2020 1:04:32 PM 7056 (0x1B90) ++++++ App enforcement completed (57 seconds) for App DT "Office 365 Default Deployment Type" [ScopeId_33814590-F115-450C-96FE-8280E96B BAB2/DeploymentType_b3950316-23f7-4364-ba95-e5a6b62be403], Revision: 3, User SID: S-1-5-21-3059720730-154124774-1305165328-1105] ++++++ AppEnforce 12/21/2020 1:04:32 PM 7056 (0x1B90)
Remove All Office Products – Office 365, Visio, Project
In addition to Office 365, you may have Visio, Project and other apps installed on a computer. To remove Office 365, Visio, Project, Proofing tools and all office products here is the solution.
Create a new xml file and enter the below info. You may exclude the logging path. The <Remove All=”TRUE”> does the trick here.
<Configuration> <Remove All="TRUE"> </Remove> <Display Level="None" AcceptEULA="TRUE" /> <Logging Path ="C:\temp\O365"/> </Configuration>
I am going to save this file as uninstall1.xml and save it in the folder where we have O365 setup files.
To deploy this xml file, we will create a new package. Now why package and not an application ?. I simply don’t want to create an application because with application I need to add a detection method. With package it’s going to be really easy and simple. You may create a new application and deploy it if you wish to.
To create a new package, go to Software Library > Application Management > Packages. Right click Packages and click Create Package.
Specify package name and enter the command line as setup.exe /configure uninstall1.xml. Let the package run as hidden as we don’t want users to see anything during uninstallation.
Deploy this package to your device collection and test the Office 365 uninstall.
On a client computer, I have got Office 365 Apps for Enterprise and Microsoft Project STD 2019. Let’s install the package on this computer.
The package works as expected and uninstalls Office 365 plus Visio, Project apps.
Executing program setup.exe /configure uninstall1.xml in Admin context Successfully selected content location C:\Windows\ccmcache\a execmgr Executing program as a script execmgr Successfully prepared command line "C:\Windows\ccmcache\a\setup.exe" /configure uninstall1.xml execmgr Command line = "C:\Windows\ccmcache\a\setup.exe" /configure uninstall1.xml, Working Directory = C:\Windows\ccmcache\a\ Running "C:\Windows\ccmcache\a\setup.exe" /configure uninstall1.xml with 32bitLauncher Program exit code 0 execmgr Script for Package:IND0001C, Program: Uninstall Everything succeeded with exit code 0 execmgr
Hi Prajawal Ji, Can you guide me steps for unistalling MS- Office old versions in user machines using SCCM.
Actually there is no msi or exe file available for unistallation deployments
Hi Prajwal,
Can you post How to uninstall MS office old versions automatically using SCCM.
we dont have .msi or .exe files available for uninstallation deployments
Hi Prajwal,
thanks a lot for the explanation and also for the correct syntax to use in the configuration.xml – file.
Your website is always one of my favourites when it comes to unterstanding Microsoft 🙂
Kind Regards,
Thank you so much.
Hi Prajwal
It took me 9 attempts to finally remove Office 365 via xml.
Thank you for the correct hints so that my uninstall.xml finally works.
Hi Prajwal,
My question can I use the .xml file to uninstall Skype (which I know) but the company I work with is using Office Professional Plus 2016, not Office 365. in this case what I have to put in Channel and Product ID? also does office 2016 pro plus have a channel or not?
How to remove Skype for Business only via Command Line/Intune
I’d have a hard time recommending this method to anyone, not by any fault here but more to Microsofts. Utilizing this method, uninstalling the applications requires the caching of the entire 365 Apps deployment which will likely be 4gb+ where the actual content required to perform the uninstall is <7MB. It would be nice if Microsoft automatically provided a setup.exe inside the applications root directory to reference or you could pre-deploy the files to workstations in your environment. The other option is using the OfficeClicktoRun.exe but I believe that spawns child processes which SCCM may not recognize and move on to app detection before the uninstall actually happens.
I should have been a bit clearer here as I completely forgot to include the option I’d suggest. At step two under the Content tab you can select an alternative content source for your uninstall. Create a folder with only the setup.exe and whatever custom uninstall XML files you need (Office, Project, Visio, Languages, etc) and use that as the source content location for your uninstalls across the products.
Hi Prajwal,
One more comment about line:
Please assist – if this folder does not exist in system drive, how to make it be created or it will never work so? I made XML like that and this folder was not created. 🙂
Hi Prajwal,
Thanks a lot for this great Article.
Wanted to add about very last step, where to check Log file for Full Office uninstall via Package, it is file:
C:\Windows\CCM\Logs\execmgr.log