Execute on server - Windows/Powershell/Teams

Hello ppl,

Version: 4.beta3,
Os: Windows Server 2016

Its a Notify topic. I am trying to execute a local powershell on the server:

"powershell.exe -ExecutionPolicy Bypass -RunType $true -Path C:\Tools\NotifyTeamsChannel.ps1 -text "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])""

Is this going to work ? Does the Windows version of the old Dude able to run external commands like this ?

Thanks for your time!

Yes “execute on server” is definitely a working function. This is the reason that we have not been able to upgrade beyond 4b3 as since that version there is no longer a Windows server option for Dude. The syntax for the command is extremely unforgiving and there is not much help available for it. I’m happy to share examples of the working functions that I have set up so you can use that as a guide if you want. Just not in a position to do this easily at the moment. I don’t believe that I’ve used a powershell command for any of my functions, only batch scripts and VB scripts. I know there is some trickery necessary to get a powershell script to run as a Windows scheduled task so this is also likely to apply for a Dude function.

FYI - the following is the execute part of a probe that I wrote a few years ago:

execute("link-test.bat",concatenate(device_property("FirstAddress")," ", device_property("CustomField2")),"c:\\snmpget")

“link-test.bat” is the batch script to be run
concatenate(…..) puts together some parameters to be fed into the batch script
the batch script is in the C:\snmpget folder on the Dude server. Note the double back-slash in the command which I needed to put in to get Dude to correctly interpret the path.

I have some other examples but this was probably the simplest I can dig up at the moment.