Ad Widget

Collapse

Powershell invocation from zabbix_agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karel_b
    Junior Member
    • Feb 2017
    • 7

    #1

    Powershell invocation from zabbix_agent

    I have found strange behaviour regarding execution of powershell as UserParameter in windows Zabbix agent.

    When I am using this
    UserParameter=certcheck,powershell -nologo -Noprofile -ExecutionPolicy Bypass -command "Get-ScheduledTask -TaskName CacheTask"
    It works as expected, zabbix_get returns textual output of the powershell command, the same value as if I started powershell from windows CMD


    But this
    UserParameter=certcheck,powershell -nologo -Noprofile -ExecutionPolicy Bypass -command "Get-ChildItem -Path Cert:CurrentUser\My"
    just return nothing, only empty line.
    But the powershell commnad invoked from windows CMD shows me expected value - list of my certificates.

    Please any ideas what I am doing wrong? The commands are nearly identical, only tryinf different powershell cmdlet


Working...