Hello,
I developped a SCCM 2012 configuration item based on two PowerShell scripts... Below is the generic structure:
- The discovery part works fine. Based on several tests, the right result is always sent back to SCCM
- In my specific case, it is expected that the remediation script is not always successfull (for instance, I could attempt to free up some disk space and it might not be possible to go back above the specified thresold to be compliant)... In such a case, my problem is that the remediation script reports a status "OK" while I am expecting to get "not ok (even after remediation trial)"
Does anybody see something wrong in my script structure ? Or do I misunderstand how to properly handle return code for configuration item scripts ?
Regards.
Discovery.ps1
if ("test if compliant") {
"ok"
} else {
"not ok"
}
Remediation.ps1
### Execute commands here to remediate the configuration ###
### Test again to see if the client is now compliant
if ("test if compliant") {
"ok"
} else {
"not ok (even after remediation)"
}