Intune Management Extension Deep Dive – Win32 App Deployment Troubleshooting Help Guide

Welcome to today’s post titled Intune Management Extension Deep Dive Level 300.

This post will show you how Intune Management Extension (IME), a.k.a Intune Sidecar, handles win32 app deployment on a managed Windows 10 endpoint.

This post intends to help you easily identify why a particular win32 app deployment from Intune ends up in an error state.

The post includes the below list of errors that I have encountered related to Intune win32 app deployment.

Patch My PC
  • (0x80070004)
  • (0x8007026B)
  • Access is denied.(0x80070005)
  • Error downloading content.(0x87D30067)
  • Error unzipping downloaded content.(0x87D30065)
  • Failed to retrieve content information.(0x87D30065)
  • The Application was not detected after the installation was completed successfully(0x87D1041C)
  • The content Delivery network used for downloading application content times out(0x87D33006A)
  • The system cannot find the file specified(0x80070002)
  • The unmonitored process is in progress. However, it may timeout(0x87D300C9)
  • The user logged off while the app policy was being processed(0x87D300CD)
  • Unknown(0x87D30000)

However, the above list is not exhaustive, and there is a good chance you can encounter a different error. The aim is to help you relate to the error source and determine the cause.

Before starting with the actual content, and since this post targets Level 300 knowledge, let’s first understand how an application is packaged to be deployed as a win32 app from Intune.

Get to know the.INTUNEWIN package

Intune natively supports the deployment of Windows applications with extensions MSI, MSIX, APPX, and APPXBUNDLE as Line-of-Business (LOB) applications to the managed Windows 10 endpoints.

However, Intune cannot deploy an application a . EXE app package to an endpoint natively. From my understanding, this is probably for the same reason as to why you can’t send/receive an EXE file directly as an email attachment (security risk!).

Adaptiva

This is where the Intune Management Extension (IME), a.k.a Intune Sidecar, comes into the picture, and with it comes the new app package extension “.INTUNEWIN“.

.INTUNEWIN is a wrapper to contain the application executable source file (.EXE) along with its INSTALL and UNINSTALL commands (and other dependent files, if any)

Intune Management Extension - Get to know the .INTUNEWIN app package at deeper level.
Intune Management Extension – Get to know the.INTUNEWIN app package at a deeper level. 1
  • Arrange the application source file (.EXE) and the Install/Uninstall commands (VB script/PS script/CMD/Batch) to a single folder. This will be specified as the Source folder.
  • Specify the path to the Source folder.
  • Specify the application source (.EXE) file.
  • Specify the path to the Output folder. [This is where you will find the prepared.INTUNEWIN file]
Intune Management Extension - Get to know the .INTUNEWIN app package at deeper level.
Intune Management Extension – Get to know the.INTUNEWIN app package at a deeper level. 2
 PS D:\App Package> .\IntuneWinAppUtil.exe
 Please specify the source folder: D:\App Package\Source Folder
 Please specify the setup file: GoogleChrome-8604240193-x64-100.exe
 Please specify the output folder: D:\App Package\Output Folder
 Do you want to specify catalog folder (Y/N)?N
 INFO   Validating parameters
 INFO   Validated parameters within 14 milliseconds
 INFO   Compressing the source folder 'D:\App Package\Source Folder' to 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\IntunePackage.intunewin'
 INFO   Calculated size for folder 'D:\App Package\Source Folder' is 71372729 within 1 milliseconds
 INFO   Compressed folder 'D:\App Package\Source Folder' successfully within 2390 milliseconds
 INFO   Checking file type
 INFO   Checked file type within 3 milliseconds
 INFO   Encrypting file 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\IntunePackage.intunewin'
 INFO   'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\IntunePackage.intunewin' has been encrypted successfully within 228 milliseconds
 INFO   Computing SHA256 hash for C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\58b1fa89-ea9a-4f94-9aaf-e0024c48387d
 INFO   Computed SHA256 hash for 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\58b1fa89-ea9a-4f94-9aaf-e0024c48387d' within 758 milliseconds
 INFO   Computing SHA256 hash for C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\IntunePackage.intunewin
 INFO   Computed SHA256 hash for C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\IntunePackage.intunewin within 765 milliseconds
 INFO   Copying encrypted file from 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\58b1fa89-ea9a-4f94-9aaf-e0024c48387d' to 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\IntunePackage.intunewin'
 INFO   File 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Contents\IntunePackage.intunewin' got updated successfully within 128 milliseconds
 INFO   Generating detection XML file 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage\Metadata\Detection.xml'
 INFO   Generated detection XML file within 43 milliseconds
 INFO   Compressing folder 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage' to 'D:\App Package\Output Folder\GoogleChrome-8604240193-x64-100.intunewin'
 INFO   Calculated size for folder 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage' is 70215616 within 0 milliseconds
 INFO   Compressed folder 'C:\Users\JoymalyaBasuRoy\AppData\Local\Temp\5798cbc1-a8ad-4d83-b2fe-8748b42c113a\IntuneWinPackage' successfully within 561 milliseconds
 INFO   Removing temporary files
 INFO   Removed temporary files within 8 milliseconds
 INFO   File 'D:\App Package\Output Folder\GoogleChrome-8604240193-x64-100.intunewin' has been generated successfully
  
  
 [=================================================]   100%                                                 
 INFO   Done!!!

A simple process, isn’t it?

If you look into the output of the IntuneWinAppUtil as above, you will see that the tool is doing the below steps.

  • Creates a folder named IntuneWinPackage in the Output folder as specified.
  • Compresses the contents of the Source folder as specified to create a .intunewin file and encrypts it using the SHA256 algorithm.
  • Creates a subfolder named Contents under the IntuneWinPackage folder to store the compressed and encrypted file (.intunewin) created in the above step.
  • Creates another subfolder named Metadata under the IntuneWinPackage folder, where it stores the encryption info to the Detection.xml file.
  • Compresses the IntuneWinPackage folder as a whole to create the outcome as a .intunewin package.
Intune Management Extension - Get to know the .INTUNEWIN app package at deeper level.
Intune Management Extension – Get to know the.INTUNEWIN app package at a deeper level. 3

Creating Win32 App in Intune – Know the backend activities performed by Intune

As we make the application in Intune, what happens in the background? You can see the high-level steps below:

  • The .intunewin app package gets uploaded to the Azure Storage account of the tenant
  • Intune decompresses the package to retrieve the Detection.xml from the Metadata folder of the IntuneWinPackage as obtained.
  • The actual app content, which is present as an encrypted .intunewin within the Contents folder, is submitted to the CDN.
  • The decryption info (as retrieved from Detection.xml) is tagged to the app

When a request for the app comes (user-initiated for Available deployment, Intune initiated for Required deployment), the download URL to the encrypted .intunewin is delivered to the endpoint.

The IME agent creates a download job to get the file downloaded to the endpoint. Intune also sends down the decryption info for the IME agent to be able to decrypt and unzip the contents.

GET CONTENT INFO FROM SERVICE,RET = 
{
"DOWNLOADURL\": "LINK TO CDN"
"DECRYPTINFO\":
}

If you want to retrieve the source contents from a win32 app package uploaded to Intune, check this awesome blog post on Oliver Kieselbach.

Overview of how the Intune Management Extension (IME) agent handles Win32 app deployment

In a nutshell, the activity as performed by the Intune Management Extension (IME) agent to handle a win32 app deployment can be summarized below.

The IME agent on the managed Windows endpoint polls the Intune service to check for any active app deployment. If found, start processing the application as per the conditions (Applicability) and criteria (Detection) set by Admin while creating the app package.

IME agent retrieves the.INTUNEWIN package file from service, unwraps it to recover the original application. EXE file and executes it using the provided INSTALL command.

IME agent post executing the application, monitors the installer process and post-install, checks the install success as per criteria (Detection) to report back to the service.

The above is only to help understand the process easy as we will dive deeper into the details below.

Deep Dive into IME Agent Win32 App Deployment Backend Process

IME Agent has to go through the following phases to process a Win32 app deployment on the endpoint.

  • Polling Phase Start
  • Retrieve Content Metadata
  • Pre-Install Detection
  • Applicability
  • Extended Requirements
  • Download
  • Integrity Check and Unzip
  • Installation
  • Post-Install Detection
  • Set Compliance
  • Report Status
  • Polling Phase
Intune Management Extension - The phases in which the IME Agent processes a Win32 app deployment on a managed Windows 10 endpoint
Intune Management Extension – The phases in which the IME Agent processes a Win32 app deployment on a managed Windows 10 endpoint 4

You can easily see this by going through the Intune Management Extension logs located at C:\ProgramData\Microsoft\IntuneManagementExtension\Logs

A summarized step of action is given below.

  • IME agent initializes.
  • IME agent discovers Intune endpoint  https://fef.msuc##.manage.microsoft.com/SideCar/StatelessSideCarGatewayService
  • IME agent fetches AAD token via impersonating logged-in user account.
  • IME agent starts application polling to query available/required Win32 app.
  • IME agent gets application policy (detection/applicability/extended requirement check details).
  • IME agent checks if the application as queried has any dependencies declared.
  • IME agent post dependency check, if the app is standalone, starts running the Detection Logic
    • SideCar will run a WMI query against the MSI code defined for MSI code-based detection.
    • For Path-based detection, SideCar will traverse the PATH as defined to check the presence.
    • For Registry-based detection, SideCar will check the specified reg_path for the presence of the reg_key and its value.
    • For a custom script-based detection, SideCar ExecManager will trigger the script and, based on the exit status of the hand, will determine the result.
  • If pre-install detection is determined as False, the IME agent will check the applicability and extended requirements.
  • If all parameters are satisfied, the IME agent will proceed with downloading the package. A corresponding BITS job gets created for the same.
  • Once the download job is complete, it will check the package integrity, decrypt the package using the encryption info provided in the content response, and unzip the content to IMECache.
  • IME agent creates the installer process in Machine/User session based on app deployment context.
  • After executing the installer process, the IME agent runs the Detection rules once more to confirm the installation.
  • Only if post-install detection is determined as True has the app install been deemed a success by the IME agent.
  • IME sets the compliance state and creates an app report to be sent back to service based on the post-install detection result.
  • The report is sent and locally saved to cache.
  • IME agent stops the current app polling session.

Relating errors to each phase of IME in which it handles a win32 app

The error that you get from the Intune portal for a Win32 app deployment can be due to a mistake in the win32 app handling by the IME agent at any of the phases as discussed above.

As such, it is important to relate the displayed error to its source to identify if the error is due to

  • The app package itself (problems with the source), or
  • Any configuration issues while creating the app in Intune (problem with detection or another config), or
  • Network-related issues (problem with delivery and download of the package).

So let’s start and see what probable errors you might get in each phase of the Intune Management Extension while the IME agent processes a Win32 app deployment on the endpoint.

IME Win32 SideCar Agent Polling Phase Start

For IME to work, it needs to get the token. It fetches the same by querying the currently logged-on user profile.

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 1

With the AAD token, IME proceeds to the next phase, where it reaches out to the service to get the application policies made available to the user/device.

As you can understand, the most common error in this phase is due to IME being unable to get the token. You can expect to see a log entry like the one below in such a case.

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 2
Intune Management Extension Deep Dive – Win32 App Deployment Troubleshooting Help Guide 5

Or, if you have AAD joined post OOBE setup from Settings unless you switch users and login with your AAD account, you would expect to get this.

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 3
Intune Management Extension Deep Dive – Win32 App Deployment Troubleshooting Help Guide 6

Retrieve App Metadata

Once IME has got the token, it checks the current proxy and sends a network request to the service to fetch the Win32 apps (policies)

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 4

The result as received is used by IME to get the detection methods, applicability checks, and requirements checks as configured for this app.

An error that can occur in this phase is due to network connectivity resulting Failed to retrieve content information(0x87D30065)

Pre-Install Detection Check

Detection can be based on Registry, MSI Product code, or File Path as configured while creating the app in Intune portal.

Intune Management Extension (IME) - Detection Rule
Intune Management Extension (IME) – Detection Rule 7

It can also be a custom script, where the IME will trigger the script, and the detection result will be based on the script’s exit status.

Intune Management Extension (IME) - Detection Rules
Intune Management Extension (IME) – Detection Rules 8

The error that can occur in this phase is caused due to improper detection logic, which will cause IME to skip further app processing. Sample error in log show like this

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 5
Intune Management Extension Deep Dive – Win32 App Deployment Troubleshooting Help Guide 9

Applicability Check

Intune Management Extension (IME) - Applicability Check
Intune Management Extension (IME) – Applicability Check 10

IME processes the settings as specified in the app policy to check if the system meets the requirements.

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 6
Intune Management Extension Deep Dive – Win32 App Deployment Troubleshooting Help Guide 11

Error that can occur is when IME fails to query the requirements, which can be due to generic system issues.

Intune Management Extension (IME) - Exception Timed out
Intune Management Extension (IME) – Exception Timed out 12

In such cases, it will report back with the error Unknown (0x87D30000). The other common errors you can get are

  • Device architecture (e.g., x86/amd64) is not applicable for the application.
  • OS version on the target device is less than the configured minimum.

Extended Requirements Check

Intune Management Extension (IME) - Requirements Check
Intune Management Extension (IME) – Requirements Check 13

If any additional requirements have been specified in-app, IME checks if the system satisfies the same.

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 7
Intune Management Extension Deep Dive – Win32 App Deployment Troubleshooting Help Guide 14

Error in this phase depends if the IME encounters any System Exception while querying the specified rules or if a custom script is used for the purpose, then the exit code of the hand. 

Intune Management Extension Deep Dive - Win32 App Deployment Troubleshooting Help Guide 8

A most common error in this phase would be RegistryRequirementNotMet. In both the Applicability check and Extended Requirement check, you can expect a log entry like this if the specified requirement is not met.

Intune Management Extension (IME) - Win32
Intune Management Extension (IME)Win32 15

Download Phase

This is when IME downloads the app package (.intunewin) from the Intune CDN to the device.  The download is done to path C:\Program Files (x86)\Microsoft Intune Management Extension\Content\Incoming

 Intune Management Extension (IME) - Content info from Intune
Intune Management Extension (IME) – Content info from Intune 16

The error that can occur in this phase is usually due to network and dependency on the BITS service, which handles the download job as created, resulting in errors not limited to

  • Unknown (0x87D30000) – the error which is reported when the last step is defined as a success, but the current step has no defined output
  • Incorrect function (0x80070001) – generally related to invalid tasks
  • The unmonitored process is in progress. However, it may timeout. (0x87D300C9)
  • Error downloading content. (0x87D30068)
  • The content delivery network is used for downloading application content timed out. (0x87D3006A)
  • The physical resources of this disk have been exhausted (0x8007013A)

Integrity Check and Unzip the package

Post download, the file is moved to the path  C:\Program Files (x86)\Microsoft Intune Management Extension\Content\Staging\ where the IME checks the integrity of the application package as downloaded.

Intune Management Extension (IME) - Integrity Check
Intune Management Extension (IME) – Integrity Check 17

At this point, you can encounter the error The system cannot find the file specified. (0x80070002) which happens due to AV.

It is recommended to exclude the locations used by IME to be monitored by an AV as it may interfere with the process.

After post successful integrity check and decryption, the file (this is the .intunewin file as present within the Contents subfolder of the IntuneWinPackage folder) is unzipped to location C:\Windows\IMECache\

The error that can occur during this phase are

  • Error unzipping downloaded content. (0x87D30067)
  • The physical resources of this disk have been exhausted (0x8007013A)
  • Incorrect function (0x80070001)
  • Unknown (0x87D30000)

Installation Phase

IME starts the execution and sets the retry count (there is a total of 3 retries with 5 minutes intervals).

Flow for the app in User Context

It creates the installer process by fetching an elevated token for the current user if the app is in User Context. It is not very common, but if IME fails to get an elevated token for the user, it can result in access being denied. (0x80070005)

 Intune Management Extension (IME) - Access is Denied
Intune Management Extension (IME) – Access is Denied 18

Before IME could create the installer process, if a change in session is detected like log-off, it will cause an error like the below, resulting in The user logging off while the app policy was being processed. (0x87D300CD)

Intune Management Extension (IME) - Error code 2
Intune Management Extension (IME) – Error code 2 19

Flow for the app in Device Context

Intune Management Extension (IME) - Unable to get error code
Intune Management Extension (IME) – Unable to get error code 20

You can safely ignore that StatusService warning.

The installer process created by IME has a predefined timeout of 60 mins if the function fails to install the application during this time, which may be due to system activity (high CPU utilization), such case results.

  • Unknown (0x87D30000)
  • The unmonitored process is in progress. However, it may timeout. (0x87D300C9)

In general, errors in this phase are directly related to the application and are usually thrown by the IPExitCode or last result. For example, if the installation is triggered via a script, the IPExitCode will define Success or Error.

Intune Management Extension (IME) - IPExitCode
Intune Management Extension (IME) – IPExitCode 21

You will mostly see the undefined errors as thrown by LastHResult like this.

  • (0x80070004)
  • (0x8007EA61)
  • (0x8007EA68)

If the installer process fails, IME has a retry check of 3 – it tries 3 times to get the app installed if it encounters any failure during a processing cycle.

The retry interval is 5 mins from the last failure. However, IME will start from the beginning of the app processing phase for each retry. The detection, applicability, and extended requirements will again be checked.

When it comes to the download phase, it will not again initiate a download but will find the app package from Cache itself.

This is because the contents of the  C:\Windows\IMECache\ folder are cleaned up successfully post-install only. At this point, you are most likely to encounter the error. The system cannot find the file specified. (0x80070002) which happens due to AV.

Post-Install Detection Phase

This is the phase where IME triggers the detection manager to execute the detection rules once more to confirm the app install status.

Even if the installation is done, but the detection rule is not capable of checking the right place, it will result in an IME report the same as a failure.

Intune Management Extension (IME) - Post Install Detection
Intune Management Extension (IME) – Post Install Detection 22

Error in this phase is caused again due to improper detection logic

Intune Management Extension (IME) - Improper Detection Logic
Intune Management Extension (IME) – Improper Detection Logic 23

At this stage, a change in session will cause IME to report back as The application was not detected after the installation was completed successfully (0x87D1041C).

Set Compliance State

This is the phase where IME sets the compliance for the app policy based on the outcome of the Installation phase and Post-Install Detection phase results, cleans the contents from the IMECache folder, and creates the app report.

Intune Management Extension (IME) - Set Compliance State
Intune Management Extension (IME) – Set Compliance State 24

Same as above, if a change in session is detected, it will result in The application was not detected after the installation was completed successfully (0x87D1041C). If the install is successful, but the post-install detection result is false, it will still report as an error as below.

Intune Management Extension (IME) - Application was not detected
Intune Management Extension (IME) – Application was not detected 25

Report Status to Service

The last phase of app processing is where IME sends the result to the service and saves the results locally.

Intune Management Extension (IME) - Report Status to Service
Intune Management Extension (IME) – Report Status to Service 26

IME can fail to send the report and save it for the below reasons

  • Network connectivity issue
  • User logs off before IME can send the final app results or any Session change detected
  • The system goes to sleep due to inactivity

which all points to the same error. The application was not detected after the installation was completed successfully (0x87D1041C)

In the case where the IME client itself faces some error, it might cause the Client error to occur (0x87D300CA)

Intune Management Extension (IME) - Client Error
Intune Management Extension (IME) – Client Error 27

and requires evaluation of the ClientHealth.log from C:\ProgramData\Microsoft\IntuneManagementExtension\Logs

The Client Health evaluation is performed every 8 hours.

Since the application is not enforced by Intune but depends on the user in the Available app flow, IME does not re-evaluate the app status if it fails in the 1st instance.

In case of Required app flow, IME will continue to re-evaluate each app result in each cycle.

As such, even if the application was installed but due to any issues reported as “The application was not detected after installation completed successfully (0x87D1041C), IME won’t re-evaluate to correct it in the subsequent sync cycles.

But for a required application, even if it is reported as an error (unless an error is related to the package itself), it is good to be corrected in the subsequent sync cycles.

The End

That was all. I hope you will find this post useful.

Starting 1st Jan 2021, I have started my blog site. You will find all my latest posts on Intune here at joymalyabasuroy.com

Resources

10 thoughts on “Intune Management Extension Deep Dive – Win32 App Deployment Troubleshooting Help Guide”

  1. Great stuff, Joymalya. Thanks.
    Good to see this issue on unzipping error in your blog: “Error unzipping downloaded content. (0x87D30067)”. In my case this has to do with a “PathTooLongException” where the depth of some package files after unzipping becomes too lengthy (something over 248 characters…??). Any idea on how to resolve this, please?
    Thank you

    Reply
  2. Great post.
    How does IME handle an version update to a package marked as successful install? Can the existing app be reused or do you need to create a second version?

    Reply
  3. Error code: 0x87D30067
    Error unzipping downloaded content.

    That is usual Microsoft ZERO helpful error. How can I even start tackling it?

    Reply
    • I have seen this for win32 app packages which contain not only files but nested folders within which need to be created upon unzipping, however, it was more of a problem with filenames which was fixed with the Intune Win32 Prep Tool v.17 with support for Unicode file and folder name. Also, the incoming win32 package is downloaded to location C:\Program Files (x86)\Microsoft Intune Management Extension\Content\Incoming\ post which is then moved to C:\Program Files (x86)\Microsoft Intune Management Extension\Content\Staging\ from where the IME client tries to unzip the contents to C:\Windows\IMECache. Thus there can be any file operation error resulting in the IME error you see. Also, the IME client works by impersonating the current logged in user if the app is a user-context app, and if the end-user is a standard user on the endpoint, may result in privilege issues while creating the processes. There can be many possibilities and it really requires a proper check-up by the app packaging team who handles and tests app packages.

      Though I do agree with you that sometimes, Intune errors really don’t make sense unless we dig deeper.

      Reply
  4. Excellent post. Thank you. Question : what s the reason for the detection rules be checked before installation? Makes no sense to me.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.