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.
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
Need more help?
If you need further assistance on the above article or want to discuss other technical issues, check out some of these options.