Hello!
I'm a PowerShell dummy and in general not great with scripting or programming so I guess this is a simple question for anyone familiar with PS...
I have a very simple script that should be run when an IIS App Pool is down. It looks like this:
Invoke-Command -ComputerName "my_server" -ScriptBlock { Start-WebAppPool -Name "WsusPool" }
Works fine if I set the computername as the DNS name or IP manually in the script. But it would be nicer to feed the script the value of the device that generated the alarm. I tried setting the parameter in the notification settings to '%host' and edited the script to contain -ComputerName "%host" but it didn't work. So how do I tell the script to replace the value for -ComputerName with the value from the parameters from PRTG notification?
Thanks in advance for any help on this!
All the best M.
Add comment