Niklas Blog

Exploring Device Management.

Testing Microsoft Intune software packages in the Windows System context

31 December 2023

Testing Microsoft Intune software packages in the Windows System context

In the realm of IT and modern workplace solutions, Microsoft Intune plays a pivotal role in managing and deploying applications across your organization’s Windows devices. However, ensuring a seamless user experience requires meticulous testing, especially when it comes to software packages deployed in the Windows System Context. This blog post explores why testing in this context is a vital recommendation and provides you with a practical solution using PsExec from the Sysinternals Suite.

Why Test in the System Context?

Before we dive into the how, let’s understand the why. When you create software packages for deployment with Microsoft Intune, some applications may run under the Windows System Context. This is where the Intune Management Extension (IME) operates, handling various tasks related to application installations and updates. Testing your software packages in this context is crucial for several reasons:

User Experience: Applications running in the System Context may behave differently than in a user’s session. For instance, any user interface elements, like installation dialogs, may be hidden from the end-user. This can impact the user experience and functionality, making it essential to uncover such issues before deployment.

Troubleshooting: Identifying and resolving issues in the System Context is often more challenging, making proactive testing imperative. Catching and fixing potential problems at this stage can save you from troubleshooting headaches later.

Optimization: Testing in the System Context provides insights into the performance and behavior of your application under different conditions, allowing you to optimize its deployment for a more efficient user experience.

How to Test in the Windows System Context

To test your software packages in the Windows System Context, you can leverage PsExec, a powerful tool from the Sysinternals Suite. PsExec allows you to launch something in the session as „NT Authority\System“ the same context in which the IME operates.

Here’s how to do it:

  • Download Sysinternals Suite: If you haven’t already, download the Sysinternals Suite from the official Microsoft website HERE. Or download PsExec seperatly from HERE.
  • Prepare Your PowerShell Script or Application: Make sure your PowerShell script or application package is ready for testing. Ensure it’s in a deployable format, such as an MSI, EXE, or PowerShell script. I would recommend you to package apps for Intune with PSADT or a small PowerShell wrapper script to extend posibillities.
  • Use PsExec: Open a PowerShell or command prompt and navigate to the directory where you downloaded PsExec. Then, use the following command:
.\PsExec.exe -s powershell

This command will launch a PowerShell session in the System Context.

Typing „whoami“ will show you that you are now interacting as „NT Authority\System“:

  • Run Your Tests: Within the PowerShell session, you can now execute your PowerShell scripts or install your application as if it were running under the System Context. This enables you to observe any hidden UI elements or unexpected behavior that might occur when your application is deployed.

If you want to display prompts or notifications to a user during the Installation of an app through Microsoft Intune you need some more work. Stay tuned as I am about to post on how to do that with PSADT, ServiceUI and Microsoft Intune.

Conclusion

In conclusion, testing your software packages in the Windows System Context before deploying them with Microsoft Intune is a best practice that can save you from potential user experience issues and troubleshooting headaches. By using PsExec from the Sysinternals Suite, you can effectively simulate the System Context and ensure that your applications perform flawlessly in this environment.

Remember that a smooth deployment experience is key to user satisfaction and efficient IT management. Testing in the System Context is a proactive step that will help you deliver a seamless and trouble-free user experience, making your IT environment even more efficient and reliable.