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
C:\Windows\ccmcache\2>startcloudwatchAgent-Windows.bat
****** 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
C:\Windows\ccmcache\2>startcloudwatchAgent-Windows.bat
****** 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
C:\Windows\ccmcache\2>
I have attached the screenshot for package how I have setup in SCCM