Hello,
as this agent is often also used for monitoring IIS web servers it would be beneficial to also add some paramtzers to the given process.
In terms of IIS all websites are processed by w3wp.exe but with different app pools.
maybe something like this
`function Check-IISWorkerProcess {
param (
[Parameter(Mandatory=$true)]
[string]$AppPoolName
)
$workerProcess = Get-Process -Name "w3wp" -ErrorAction SilentlyContinue |
Where-Object { $_.CommandLine -like "*-ap `"$AppPoolName`"*" }
if ($workerProcess) {
return 1
} else {
return 0
}
}`