Menu
CCMEXEC.COM – Enterprise Mobility
  • Home
  • General
  • Configuration Manager
  • Windows 10
  • Windows 11
  • Intune
  • GitHub
  • About
CCMEXEC.COM – Enterprise Mobility

Test application installers in System context using a Schedule Task

Posted on September 22, 2017September 22, 2017 by Jörgen Nilsson

When deploying an Application using SCCM or Intune for that matter, the installation is run in System Context if you don’t select to run it as the user. I have answered this question I think once a day this week on Technet forum where the application fails when deployed using SCCM but works when tested manually.
To test an application that are to be deployed using SCCM/Intune it must be tested by installing it in System context not as a logged-on administrator, then you will spot all errors with custom actions in and MSI that checks for currently logged on user or issues like that.

To test an application Psexec, from SysInternals, is a great tool, there is however a simpler way, using the Task Scheduler which is already there. Psexec is not allowed by some Anti-Malware for instance but the Task Scheduler is.

I start by copying my installation files to C:\Temp on my test machine. Then launch Task Scheduler and select “Create a Task”

  1. Give it a name and set that it should run in System Context as shown below.
  2. Then we skip to the Actions tab and select “New”
  3. We use the “Start a program” task
    And as an argument we use the following commands to run the .MSI silent and with verbose logging. /i “C:\temp\7z1701-x64.msi” /QN /L*V “C:\temp\7z1701-x64.log”
  4. Select OK

Then we ready to start our task to install 7-zip under the System Context by simply select “Run” in the Task we created.

When the task is finished 7-zip is installed, if we look in the verbose .MSI log file which was created during the installation, we can see that it was run under the System Context.

Really simple!

If we use Psexec we can use the following command after downloading and unpack psexec from here: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

Example command line for using psexec to test a Windows installer package in System Context:

The result is the same as using a Schedule Task.

Testing your applications in the correct context before deploying them will save you a lot of time and headache.

Happy testing!

 

 

 

 

1 thought on “Test application installers in System context using a Schedule Task”

  1. Jeff.J says:
    September 22, 2017 at 4:21 pm

    Any tips on how to troubleshoot an Application that installs in the System context just fine with psexec or scheduled tasks but not SCCM/Intune?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

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

My name is Jörgen Nilsson and I work as a Senior Consultant at Onevinn in Malmö, Sweden. This is my blog where I will share tips and stuff for my own and everyone elses use on Enterprise Mobility and Windows related topics.
All code is provided "AS-IS" with no warranties.

Recent Posts

  • New settings in Intune Security Baseline Windows 11 24H2 -2504
  • Managing extensions in Visual Studio Code
  • Reinstall a required Win32app using remediation on demand
  • Administrator protection in Windows 11 – First look
  • Remediation on demand script – ResetWindowsUpdate
©2025 CCMEXEC.COM – Enterprise Mobility | WordPress Theme by Superb Themes
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT