VMware Horizon Community
San-Infinity
Contributor
Contributor

Stop sessions if a user changes (thin)client

Dear community,

 

Currently we are experiencing a problem where users jump from thin client to thin client. They do this because of the need of different (scanner COM) devices without properly logging off. If they do, the COM port of the scanner changes and this COM port sadly static within the software. Users then need to manually change the port in the software, something which they dont want to know. Not only that, my personal believe is jumping from thin client to thin client without properly logging off and on again will only cause more complications.

Is there a way to force a session to log itself off if a user tries to log in to the same session from another device? Ive been googling for 2 hours now and going to the GPOs but im not getting any wisers. I hope any of you can help me out here. 

0 Kudos
4 Replies
Kilroy526
Contributor
Contributor

Look at the command to run on reconnect option. I have used this to close software and relaunch when a user moves from one device to another.  It is a computer GPO setting which you can set to call a script.  The script could be set to logout of the session or close the application for you.  

 

See  https://docs.vmware.com/en/VMware-Horizon-7/7.13/horizon-remote-desktop-features/GUID-8FFD8028-FB3F-...

 

 

San-Infinity
Contributor
Contributor

This is why i love the VMware community! Thank you very much for your reply.

0 Kudos
San-Infinity
Contributor
Contributor

This sadly doesnt seem to work 😞

 

Also it seems you cant run powershell commands with that GPO, at least not with elevated properties. SO i tried the following (which i entered in a .bat file):

shutdown /l /f

^ didnt work

Logoff /f

^ didnt work

@Echooff
powershell.exe
$scanner = get-pnpdevice -FriendlyName "USB Serial Device (COM*" | select-object -Property InstanceID
$scanner | disable-pnpdevice -Confirm:$false
$scanner | enable-pnpdevice -Confirm:$false
exit
exit

^ also didnt work 😞

Im now thinking of either doing a scheduled task with an "if" statement (if "com4" is found, disable and enable pnp device). Also returning to the registry of ignoring IgnoreHWSerNum. 

Wouldve been nice if there was this option to use powershell scripts when users take over their old sessions on a new device but it seems ive hit a wall. 

0 Kudos
Kilroy526
Contributor
Contributor

Sorry to hear it is not working for you.   To confirm you have  tried with and without the "-C" in the front of the command and the path is accessible.   I have used something similar to the following -C C:\WINDOWS\system32\wscript.exe \\domain\netlogon\script.vbs in the past.

 

 

0 Kudos