Forum Discussion

RajeshP's avatar
4 years ago

Using an External Script DataSource to run Powershell script

Using an External Script DataSource to run Powershell script

Attached the configuration I have, If I have to run on a different machine how do I specify the hostname ?

  • Anonymous's avatar
    Anonymous

    Why are you trying to run the script externally instead of just embedding the powershell script right in the DS? It works more cleanly that way.

    When using PowerShell to collect data, you have two options 1) you can run the PS on the collector itself, relying on the cmdlet to have a -Remote option where you would specify the target system using ##system.hostname## like in your screenshot or 2) you can run PS on the Collector, but use the Invoke-Command cmdlet, which would pass powershell commands over to the target system for those commands to be run on the target.  Details can be found here.

  • Hi Stuart,

    I want to run the powershell using latest version 7, but Logic monitor does not have an option to choose the version of Powershell in its dashboard. So I am trying to run it externally.