7.12 let you assign multiple users to the same vm
Automation like you asked is technically possible, but would be crazy to start considering the feature is available. If you can' upgrade I think you would need to put a script in the vm as logoff script and try the example here
to see if that works.
Unfortunately we are on 7.7 at the moment. We have looked at updating, but as I'm sure you know there are a lot of moving parts and with everything that is going on right now we are trying to keep costs down as much as possible.
Thank you for the info in the link. It looks like it may help us do what we are looking for. Looks like I would have to install PowerCLI on the VM as well to make it work. I'll have to investigate it further.