SCCM Compliance Rule for Finding Process Running

Here is my powershell script for finding if a  process is running with SCCM compliance rule.

$process = Get-Process Process-name-xxx -ErrorAction SilentlyContinue
if ($process) {
Write-Host “Running”
}
else {Write-Host “Not Running”}

 

And for compliance rule is to check if the value is equal to  “Running”

Leave a Comment