VMware Horizon Community
BWindmeyer
Contributor
Contributor

Commands to Run on Disconnect?

     While I'm well aware of the GPO for CommandstoRunonConnect and CommandstoRunonReconnect, is there any tricks to allow a script (or commands) on disconnect or even roaming? 

I ask as there's an application that I would like to close in the event that a user disconnects or roams to another machine due to the location awareness of that application. 

Thanks!

0 Kudos
5 Replies
mpryor
Commander
Commander

Not in the current 5.2 version no, this would be a feature request - please feel free to submit it :). For now you could have a small bit of code that registers for the session disconnect notification and that does the action you require (see WTSRegisterSessionNotification function), or you could instead try and fit it in so that it is tidied up on the next reconnect action before anything else.

Mike

0 Kudos
MayurPatel
Expert
Expert

I know this is an old post but since I came across this while searching for an issue I am encountering with CommandstoRunonConnect/Disconnect. If you don't already know in version 5.3 FR1 GPO bundle there is a new addition for CommandstoRunonDisconnect.

Hope it works for you.

0 Kudos
mpryor
Commander
Commander

I'm glad you posted that. Inclusion of the policy in the feature pack GPO files is actually a mistake that I've flagged internally - the GPO relies on agent functionality that does not exist in the 5.3 version, so you won't find that it does anything.

0 Kudos
BWindmeyer
Contributor
Contributor

Ah, thanks for this.  I'm glad to see that it's at least being tried out, and look forward to seeing it eventually.

0 Kudos
anpucci
Contributor
Contributor

At least from Horizon 7.5, the one I'm dealing with, the CommandsToRunOnDisconnect is available in the VMware View Agent Configuration ADMX.

- Andrea
0 Kudos