need help to identify the reason for installation error via SCCM package

Puneet Mandyal 1 Reputation point

Hi Team,

I need help to investigate the issue with batch script installation which I installing on the client machines through SCCM Package.

I tried to execute the script on system using command run as administrator, which executed successfully on the clied machine on the other hand if the script executing via SCCM package it return me this error

Severity Type Site code Date / Time System Component Message ID Description
Error Milestone EDN 3/28/2022 7:20:04 AM EFCTESTCW3 Software Distribution 10006 The program for deployment "EDN202AF" failed ("EDN000E0" - "CloudwatchAgent_start"). A failure exit code of 1 was returned. User context: NT AUTHORITY\SYSTEM Possible cause: Configuration Manager determines status for each program it executes. If Configuration Manager cannot find or correlate any installation status Management Information Format (MIF) files for the program, it uses the program's exit code to determine status. An exit code of 1 is considered a failure. Solution: For more information on the exit code, refer to the documentation for the program you are distributing.

If I ran the script without run as administrator it gives me this error

****** processing amazon-cloudwatch-agent ******
Region: us-west-1
credsConfig: map[]
Failed to write the json file C:\ProgramData\Amazon\AmazonCloudWatchAgent\Configs\ssm_AmazonCloudWatch-windows.tmp: open C:\ProgramData\Amazon\AmazonCloudWatchAgent\Configs\ssm_AmazonCloudWatch-windows.tmp: Access is denied.

Fail to fetch the config!

If I have run the batch script using run as administrator it executed successfully:

Microsoft Windows [Version 10.0.17763.1935]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32>cd C:\Windows\ccmcache\2

****** processing amazon-cloudwatch-agent ******
Region: us-west-1
credsConfig: map[]
Successfully fetched the config and saved in C:\ProgramData\Amazon\AmazonCloudWatchAgent\Configs\ssm_AmazonCloudWatch-windows.tmp
Start configuration validation...
2022/03/28 19:11:59 Reading json config file path: C:\ProgramData\Amazon\AmazonCloudWatchAgent\Configs\ssm_AmazonCloudWatch-windows.tmp ...
Valid Json input schema.
No csm configuration found.
Configuration validation first phase succeeded
Configuration validation second phase succeeded
Configuration validation succeeded
AmazonCloudWatchAgent has been stopped
AmazonCloudWatchAgent has been started


I have attached the screenshot for package how I have setup in SCCM 187662-capture.jpg

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,117 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Simon Ren-MSFT 26,126 Reputation points Microsoft Vendor


    Thanks for posting in Microsoft MECM Q&A forum.

    Agree with above replies. This issue may be related to the running context. We can use PsExec.exe to run the package/application under a specified credential to have a try. For more detailed information, please refer to:

    How to Access the Local System Account
    MDT/SCCM 2010 - Running Applications Installations under different credentials

    Hope it helps. Have a nice day!

    Best regards,

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.
    0 comments No comments

  2. Garth 5,786 Reputation points

    This blog show you how to test your batch file as cm deploys it.

    1 person found this answer helpful.
    0 comments No comments

  3. Limitless Technology 38,771 Reputation points

    Hi @Puneet Mandyal

    Since the issue is related to the file structure and permission of the Amazon Cloud Watch Agent, it would be recommended that you get in touch with an Amazon Cloud forum where the experts would be better experience to guide you.

    Initially, from the error message "Failed to write the json file" and "Access is denied" you should check the NTFS permissions on the affected file and folder (these may be assigned by the installed software)

    One recommendation would be to chck the configuration of your intallation account used to distribute the packages, ensuring that is included in the right containers for permissions:

    Hope this helps with your query,

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  4. Rahul Jindal [MVP] 8,496 Reputation points MVP

    Have you tried running the script in user context but with admin rights?