Quantcast
Channel: Configuration Manager 2012 - Security, Updates and Compliance forum
Viewing all articles
Browse latest Browse all 6382

PowerShell Configuration Iteam: always report compliant even if recovery is not successfull

$
0
0

Hello,

I developped a SCCM 2012 configuration item based on two PowerShell scripts... Below is the generic structure:

  1. The discovery part works fine. Based on several tests, the right result is always sent back to SCCM
  2. 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)"

}


Viewing all articles
Browse latest Browse all 6382

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>