Deploy-application.exe fails on some deploy-application.ps1 works

Been using the exe to deploy to machines via SCCM for some time but I find a few machines refuse to run the install if I use the deploy-application.exe. It basically times out on those machines and a log file is never created. Again 99% of the machines work fine when installing with the exe. This is not a single app script but all installs where I use the exe to install the products. it is just a few machines refusing to run via the exe method

So I tested running the install via deploy-application.ps1 to a machine that will not install via the EXE and it installed just fine.

Trying to figure out why some machines cant run installs via the exe. We are running Win 10 on all machines

Usually when there is not PSADT log file it’s because SCCM did not launch anything.

-Clean the SCCM cache on the affected Clients. Try again.
-Read the SCCM log files on the affected Clients. search for the name of the SCCM app.

Thanks for the suggestions. I thought the same thing. I went as far as uninstalling and reinstalling the SCCM Client on the machines affected and made sure the \ccmcache has the source and it just fails when you watch the AppEnforce.log:

Running the EXE command

App enforcement environment:
Context: Machine
Command line: “Deploy-Application.exe” -DeploymentType “install” -DeployMode “Silent”
Allow user interaction: No
UI mode: 0
User token: null
Session Id: 4294967295
Content path: C:\WINDOWS\ccmcache\5
Working directory: 1/5/2022 4:52:26 PM 27192 (0x6A38) AppEnforce
Prepared working directory: C:\WINDOWS\ccmcache\5 1/5/2022 4:52:26 PM 27192 (0x6A38) AppEnforce
Prepared command line: “C:\WINDOWS\ccmcache\5\Deploy-Application.exe” -DeploymentType “install” -DeployMode “Silent” 1/5/2022 4:52:26 PM 27192 (0x6A38) AppEnforce
Executing Command line: “C:\WINDOWS\ccmcache\5\Deploy-Application.exe” -DeploymentType “install” -DeployMode “Silent” with system context 1/5/2022 4:52:26 PM 27192 (0x6A38) AppEnforce
Working directory C:\WINDOWS\ccmcache\5 1/5/2022 4:52:26 PM 27192 (0x6A38) AppEnforce
Post install behavior is NoAction 1/5/2022 4:52:26 PM 27192 (0x6A38) AppEnforce
Waiting for process 22160 to finish. Timeout = 120 minutes. 1/5/2022 4:52:26 PM 27192 (0x6A38) AppEnforce
Process 22160 terminated with exitcode: 3762504530 1/5/2022 4:52:27 PM 27192 (0x6A38) AppEnforce
Looking for exit code -532462766 in exit codes table… 1/5/2022 4:52:27 PM 27192 (0x6A38) AppEnforce
Unmatched exit code (3762504530) is considered an execution failure. 1/5/2022 4:52:27 PM 27192 (0x6A38) AppEnforce

Now if I deploy the same app to the same machine and use the command: Deploy-Application.PS1" -DeploymentType “install” -DeployMode “Silent” it will install fine and it will create the log file in the \Logs\Software\ location.

Same machine but with the PS1 Command line mentioned above

App enforcement environment: 
            Context: Machine
            Command line: "Deploy-Application.PS1" -DeploymentType "install" -DeployMode "Silent"
            Allow user interaction: No
            UI mode: 0
            User token: null
            Session Id: 4294967295
            Content path: C:\WINDOWS\ccmcache\6
            Working directory:          1/5/2022 10:21:46 PM   11824 (0x2E30) AppEnforce
Prepared working directory: C:\WINDOWS\ccmcache\6            1/5/2022 10:21:46 PM   11824 (0x2E30) AppEnforce
Prepared command line: "C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -ExecutionPolicy Bypass "C:\WINDOWS\ccmcache\6\Deploy-Application.PS1" -DeploymentType "install" -DeployMode "Silent"   1/5/2022 10:21:47 PM   11824 (0x2E30) AppEnforce
Executing Command line: "C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -ExecutionPolicy Bypass "C:\WINDOWS\ccmcache\6\Deploy-Application.PS1" -DeploymentType "install" -DeployMode "Silent" with system context         1/5/2022 10:21:47 PM   11824 (0x2E30) AppEnforce
Working directory C:\WINDOWS\ccmcache\6 1/5/2022 10:21:47 PM   11824 (0x2E30) AppEnforce
Post install behavior is NoAction           1/5/2022 10:21:47 PM   11824 (0x2E30) AppEnforce
Waiting for process 13988 to finish.  Timeout = 120 minutes.   1/5/2022 10:21:47 PM   11824 (0x2E30) AppEnforce
Process 13988 terminated with exitcode: 0      1/5/2022 10:21:56 PM   11824 (0x2E30) AppEnforce
Looking for exit code 0 in exit codes table...     1/5/2022 10:21:56 PM   11824 (0x2E30) AppEnforce
No action needed after successful enforcement            1/5/2022 10:21:56 PM   11824 (0x2E30) AppEnforce
Performing detection of app deployment type MFS Reboot Helper 2.0.4(ScopeId_ED3DB623-73FF-4021-96B5-E137FEA1BCAE/DeploymentType_283bff65-384c-4f19-bbcb-eef5492f0d3c, revision 5) for system.            1/5/2022 10:21:56 PM      11824 (0x2E30) AppEnforce

+++ Discovered application [AppDT Id: ScopeId_ED3DB623-73FF-4021-96B5-E137FEA1BCAE/DeploymentType_283bff65-384c-4f19-bbcb-eef5492f0d3c, Revision: 5] 1/5/2022 10:21:56 PM 11824 (0x2E30) AppEnforce

I think you’ve found your solution: Don’t use Deploy-Application.exe.

can i ask why we shouldn’t use Deploy-Application.exe? I thought that was the preferred way of deploying PSADT?

I wouldn’t know if it’s truly that but I don’t use in with SCCM 2107 and earlier.
I’ve been using PSADT for about 10 years now without Deploy-Application.exe.

I tried here and there to use Deploy-Application.exe for making PSADT GUI display about 3 years ago and it caused problems. I think Deploy-Application.exe was needed at some point but not now. That said, I can’t say if you need it or not for InTune. I’ll find that out for myself come April.

I hope someone like sintaxasn can chime in to set me straight.

Deploy-Application.exe can crash if .NET Framework is not available or corrupt. You can check what .NET Framework version the pc has or check event viewer on that PC and check what error appears.

Deploy-Application.exe is preferred because otherwise you need to call
powershell.exe -ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -File Deploy-Application.ps1

From the error message it appears the Deploy-Application.exe is failing.
Try to run it manually on that computer, in interactive mode. You will get a message with the error. Maybe that will help you track the root cause.

Just an Update

Finally got onto a box where this is happening and when SCCM runs the exe it was able to display:
DeployError

Saw an older post with the same error but the fix does not apply as powershell is not being blocked when i am on the machine via GPO

We had SCCM run run the install with different users logged on to see if it failed on each. It did. Next I went to the source and opened a Command Prompt(Admin) and ran the exe with the same paramaters and the install went fine. We looked back on the SCCM appenforce install log and noticed that at the start of April is when this machine stopped being able to install PSADTK via the EXE.

We sent another SCCM app to teh machine after this and it also failed. This time i simply double clicked the Deploy-Application.exe and let it run… it installed fine. So it seems this issue is only a happening on some machines via SCCM Deployments to the machine.