Hi everyone,
i have a task to configure Health Collection Script to check if the windows activated or not, based on the returned value user will be healthy or not.
this is PowerShell script
# Get activation status
$activationStatus = Get-CimInstance -Query "Select * from SoftwareLicensingProduct where PartialProductKey is not null and LicenseStatus = 1"
# Build output message
if ($activationStatus) {
$output = @{ activationStatus = "Windows is activated." }
} else {
$output = @{ activationStatus = "Windows is NOT activated." }
}
# Convert to JSON
$output | ConvertTo-Json


access tracker logs:



what im missing? because "activationStatus" parameter not returned to ClearPass, i tried to run the script manually it's working successfully
I'm also confused because the exit code is 0 which means

------------------------------
BR,
Mohanad
------------------------------