Trying to create a diagnostic task with that runs a Powershell script to get some more information.
My troubble is that i need a parameter from the Alert/Health State to get the right information.
Been banging my head on google for the last day and don’t seem to be closer.
It the IIS 8 Application Pool state monitor, and i whant the instancename from the context as a paramter in the diagnostic so that i can do a
get-website | where $_.name -eq $ParameterFromAlert
But it doesn’t seem to work. I’v tried outputting just the Parameter but it’s Always empty.
Anyone have a working diagnostic/recovery that you can share ?
Here then is a PowerShell diagnostic script that would take that parameter and write it to the windows application event log (automatically based on the monitor being in a warning state - the enabled and execute on state parameters which you can change as per your requirements):