1. (originally posted in support forum) Terminate session opening based on Before Connect Event validation
I have been tasked with providing a solution for a "break glass" audit mechanism within RDM. I've created a powershell script that provides a graphical interface that prompts the user for information (ticket number, description, etc), validates and updates the ticket, injects the information into the session log file, then proceeds to log the technician into the session.
Since the powershell event does not have a "Wait for exit" option, I've compiled it into an executable and use the following command line event on the template.
myexecutable.exe -RDMSession $SESSION_ID$ -RDMName $NAME$
All works as expected except when the user decides to cancel. I cant seem to identify a way to prevent the session from continuing to login the user after the script has exited. I've tried a number of things. I've tried using Close-RDMSession on the cancel button event and while this does close the powershell session, it continues to open a new template session (without completing the validation requirement).
Is there some other way to prevent the session from continuing? I've been staring at this problem too long and need some thoughts outside of my box.
2. UI setting to disable "Blank Template" option - for the same reasons as item #1 above
3. A cancel button for the load inventory option - many times this will clock forever (or until I kill RDM via task manager)
4. UI setting to disable right-click context menu
#1 Honesly I'm don't have an idea how we could help. Perhaps I just don't understand your solution. Do you have the original post on the forum?
#2 Where do you see the blank template exactly?
#3 I will check what we can do. We call WMI and it's not always simple to cancel the operation.
#4 Just the context menu or all the related actions in the ribbon?
1 - The original post is https://forum.devolutions.net/topic28133-before-connect-event--terminate-session.aspx?lastpage=1#post106966
2 - This is at the bottom of the template list screen (screenshot)
3 - Whatever you can do. This is more of an annoyance than anything else. Maybe execute in a different runspace and let it process in the background?
4 - Actually it is the context menu within the navigation pane as well as the Action pane. I have the ribbon removed for users via GPO but I need to remove the options for "open with parameters"
Ultimately, I am trying to run RDM in a "kiosk" mode (if you will). All system administrative interaction should be accomplish through database templates or through custom macros\tools.
Regarding item #3, I spent some time troubleshooting this and found that the query uses the Win32_Product class which is inherently slow as it enumerates and performs a consistency check on all installed MSI packages... and if necessary... a repair.
Would it be possible to use a different query to pull software? Maybe a remote registry call?
Thank you for the idea. I will check that.