Deploy Configuration Manager Client through Intune, namely Autopilot…

There are known issues with Autopilot with regards to mixing LOB Apps and Win32 Apps that install MSI’s that may cause the Application Installation to Fail. As a result, wrapping even the simplest of MSI as a Win32 App ensures success in Autopilot Deployments… I’m not going to go into wrapping Win32 Apps, you can read the documentation here.

One thing I have notice becoming a reoccurring ask online is “How do I deploy the ConfigMgr Agent through Intune? When I try it shows as failed then a while later success.”

This is caused by how CCMSetup.exe runs. For this example, I’m going keep this simple, but you will get the idea.

Sample Installation Command Line (Installation properties can be found here):

ccmsetup.exe / SMSSiteCode=P01

Now when this executes, CCMSetup.exe will perform the following:

  • Creates a Service called “ccmsetup”
  • Starts “ccmsetup” Service
  • Exits with Return Code 0
CCMSETUP Service can be seen while the Installation of the Agent is occuring.

So, when Intune deploys this, it will deploy the Win32 Application run the command line as specified, but it isn’t looking for or even aware of the “ccmsetup” service that is now performing the install and will wait for the inital CCMSetup.exe to exit with the return code “0”, attempt to run the Detection Method and show a failure as the agent is still installing. Now a little while later when it attempts to install it a second time the Detection Method will detect that it is installed and show success.

So, this explains what is happening, now how can I fix it?

There is a simple fix for this, use the /NoService command line argument, this will prevent the initial execution of CCMSetup.exe from creating the Service and it will attempt the install.

ccmsetup.exe /noservice / SMSSiteCode=P01

Now, when CCMSetup.exe returns its return code, and the Detection Method executes it should now detect the client as being installed.

Now, for my Detection Method – I like to look for the CCMExec Service. If this service exists, then the Client is installed.

If (Get-Service -Name "CCMExec"){
    Write-Host "Installed"

I hope this has helped you understand why the Configuration Manager Client installs the way it does, and how you can work around its behaviour.