Uninstall the Microsoft Intune client

This blog post will be relatively short, but will address a common “issue” with the Microsoft Intune client and that’s the uninstall of the client. I know it’s been addressed already in a couple of blogs, but that seems to be all outdated information. Sometimes even an old batch file with all “hard-coded” MSI GUIDs is mentioned, well that’s definitely outdated by now. In my opinion there are only two real methods to uninstall the Microsoft Intune client. The first one is via the Microsoft Intune administration console and the second one is via the ProvisioningUtil.exe on the client machine. In this blog post I’ll go through both methods.

Method 1 – Microsoft Intune administration console

The first method is, by far, the easiest. This method will simply use the method that was designed to uninstall the client, and that’s using the Microsoft Intune administration console. It will simply create a scheduled task to uninstall the Microsoft Intune client and all the related components by using ProvisioningUtil.exe. This whole process can be followed in the Enrollment.log that is located in C:\Program Files\Microsoft\OnlineManagement\Logs. As anyone can imagine, this is many times better than a batch file with hard-coded MSI GUIDs, because those MSI GUIDs happen to change a lot. To trigger the uninstall of the Microsoft Intune client simply follow the next steps:

  • Retire_WipeLogon on to the Microsoft Intune administration console;
  • Navigate to Groups > All Computers and select the Devices tab;
    • Note: This can be any other Group that contains the device;
  • Retire_Wipe_DeviceSelect the device, click  Retire/Wipe and the Retire device: <device> dialog box will show;
  • Notice that Wipe the device before retiring is grayed out and click Yes;
  • Within a couple of minutes the uninstall process will be triggered on the client.

Method 2 – ProvisioningUtil.exe

The second method is a bit more difficult. This method requires one to manually run ProvisioningUtil.exe. The good readers might notice that this is the same executable, that’s being triggered, as via the retire/wipe action of the Microsoft Intune administration console. It also works the same and also creates the same scheduled task. In previous releases the uninstall command was as simple as ProvisioningUtil.exe /UninstallAgents /WindowsIntune, but this has changed with the latest releases. To be completely sure about this statement, simply navigate to C:\Program Files\Microsoft\OnlineManagement\Common and run ProvisioningUtil.exe /?. This will provide an overview about the following possible parameters:

  • image/UninstallClient – Used to uninstall the Microsoft Intune or AIS client from the machine;
  • /ServiceId – Used to specify a specific service id to scan against;
  • /TaskName – Used to specify the task to be deleted after a successful scan/download/install;
  • /SubEventId – Used to specify the sub event Id that needs to be reported for telemetry.

The funny thing, or maybe annoying for some, is that, even though the help information about ProvisioningUtil.exe indicates that not all parameters are required, all parameters are required. What makes it even better is that it doesn’t seem to use them all, but I wouldn’t be surprised to see that change in the near future. This means that it’s simply copying the example of ProvisioningUtil.exe /UninstallClient /ServiceId {GUID} /TaskName “tempTask” /SubEventId 16 and it’s almost good to go. The only piece of missing information is the GUID of the service. Locally on the client this information can be retrieved from at least one of the following places:

1 EnrollmentLogAfter the installation of the Microsoft Intune client the service ID can be found in the Enrollment.log, by searching on the sentence Initializing for service ID. This will show the GUID of the service.
2 RegistryAfter the installation of the Microsoft Intune client the service ID can be found in the OnlineManagement key that is located at HKLM\SOFTWARE\Microsoft\. This will show a key with the GUID of the service.

This completes the required information and in my case this creates a command line like this: Uninstall_CommandProvisioningUtil.exe /UninstallClient /ServiceId “{3DA21691-E39D-4DA6-8A4B-B43877BCB1B7}” /TaskName “tempTask” /SubEventId 16. To follow the uninstallation of the Microsoft Intune client take a look again at the Enrollment.log. This will also show that it slightly changed the last two parameters of the provided command line.

Note: A manual uninstall of the Microsoft Intune client doesn’t remove the device from the Microsoft Intune administration console.

Share

18 thoughts on “Uninstall the Microsoft Intune client

  1. Thank you – this worked for me. However, the syntax was slightly different for me:
    ProvisioningUtil.exe /UninstallClient /ServiceId {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7} /TaskName “tempTask” /SubEventId 16

    For some reason it didn’t recognize the ServiceId when I had quotes around it. I saw the following error in the Enrollment.Log: “Unknown service id passed in” and kept trying slight variations until it worked.

  2. Thanks, this seems to be working well. We are having to do this for tablets that get left in a drawer for 3 months and then they seem to never connect to Intune again.

    Anyone got a clever idea on how to wrap this up in a powershell script that would find the GUID, uninstall the agent, then re-install the latest agent?

  3. Peter. What if I see 2 distinct service ID’s in the registry? One is actually the same as Zack listed in his comment ServiceId {3DA21691-E39D-4DA6-8A4B-B43877BCB1B7} listed in it’s own folder in the “OnlineManagement” folder. However, when I select that folder the AccountID lists a different ID all together. I’ve tried running the ProvisioningUtil.exe etc….with both the ID’s and the enrollment log shows “unknown service id passed in …for both ID’s. FYI, the client has not updated this particular device in over 2 years.

    Thanks for your help.

  4. Hi Jamie,

    Could it be that the agent is already that old that it still requires the old removal parameters? If I’m not mistaken that was something like: ProvisioningUtil.exe /UninstallAgents /WindowsIntune

    Regards,
    Peter

  5. Yes, yes! Now why didn’t I think of that?? It’s so much easier the old way! It’s removing the program as I type. Thank you!

  6. Hi Peter,
    Thanks very much for this info. A couple of questions:
    1. What are the implications of your comment – ‘A manual uninstall of the Microsoft Intune client doesn’t remove the device from the Microsoft Intune administration console’? What control could an admin have if the client is uninstalled?
    2. Could Intune client also be uninstalled using a System Restore to a restore point set prior to its installation?
    Thanks!

  7. Hi Nay,

    1. No implications. It will be an object in the console that will be inactive. The administrator has no control when the client is removed.
    2. I would say, yes.

    Peter

  8. Many thanks for your response Peter. Just to quickly follow up on my second question and make sure I understand – so I as an admin would be able to see in the console once one of the clients has been removed, correct? I’m just concerned that someone goes and removes their Intune client without me being able to know about it! Thanks again.

  9. When using Method 1, can I select more than just 1 device to remove the client? Or do I have to do that method 1 device at a time?

Leave a Comment