Hi, I've just started using the following template to monitor my windows scheduled tasks:
https://share.zabbix.com/operating-s...hes-planifiees
So it works perfect but the only problem is it doesn't pull the scheduled task state ( Disabled or Enabled ).
Now, I tried to edit the powershell script my self and added the following lines:
But it doesn't seem to work, I get the error below when I try to execute the item:
Value of type "string" is not suitable for value type "Numeric (unsigned)". Value ""
I get empty value for some reason, Anyone here can help me please? :P
Thank you!
https://share.zabbix.com/operating-s...hes-planifiees
So it works perfect but the only problem is it doesn't pull the scheduled task state ( Disabled or Enabled ).
Now, I tried to edit the powershell script my self and added the following lines:
Code:
switch ($ITEM) {
"TaskStatus" {
[string] $name = $ID
$name1 = $name.replace('â','â').replace('à','à ').replace('ç','ç').replace('é','é') .replace('è','è').replace('ê','ê')
$pathtask = Get-ScheduledTask -TaskPath "*" -TaskName "$name1"
$pathtask1 = $pathtask.Taskpath
$taskResult = Get-ScheduledTask -TaskPath "$pathtask1" -TaskName "$name1" | Select State
Write-Output ($taskResult.Status)
Value of type "string" is not suitable for value type "Numeric (unsigned)". Value ""
I get empty value for some reason, Anyone here can help me please? :P
Thank you!
Comment