0
We want to run a script when user tries to disconnect a remote session (using Remote Desktop) by clicking the "X (close)" button. Any help on the event that gets triggered on clicking "X/close" button in remote session would also help us. The Script should run before the disconnection is complete. Basically when the system prompts user for confirmation of disconnection. We are using Windows Server 2016.
(1) If you’re running Windows Server 2016, why did you tag your question [Windows Server 2012] and not [Windows Server 2016]? (2) When you say “when user tries to disconnect”, do you mean that (a) the script should run before the disconnection is complete, and/or (b) the script should be able to prevent the user from disconnecting (I suspect that this will be impossible)? Please do not respond in comments; [edit] your question to make it clearer and more complete. – Scott – 2018-03-12T23:10:13.173