Hello everyone, I am fairly new to using the powershell monitor in SAM. I have a working script that can be ran to return the value of the TSServerDrainMode registry key which tells you if the RD session host in question is allowing new connections. I have been working on making the script work for awhile and it is fully functional. The problem i am facing now though is how to get the powershell monitor to exit with the correct status or a status at all. Right now i have only been able to get a "Not defined" response in the script output when setting up the monitor below is my working script.
Below is image of how i have it setup
I have also tested against multiple servers
Any help is greatly appreciated!!!
