Hello tom5,
Please check nxerror.log, it might show more detailed error from script. In order for session
to work correctly it’s necessary for the custom script to finish with 0.
It’s enough to use UserScriptAfterSessionClose. Do you set it in node.cfg or server.cfg?
Please take into account that if you use server.cfg than script will be run as user ‘nx’,
if you use node.cfg than script will be run as desktop owner.
There’s also EnableLockScreen key in server.cfg, it’s designed to lock screen when
user disconnects from physical desktop, if it fits your needs.