VMware Horizon Community
Najtsob
Enthusiast
Enthusiast
Jump to solution

Run script inside user VM when user connects or reconnects

Hello,

is it possible to detect inside user VM that user has connected or reconnected to his desktop and run some script ?

Also is it possible inside user VM to find out if user is connected and how long?

One way to do it is via following powershell command, but this works only if user is connected via PCoIP protocol.

Get-WmiObject -Class Win32_PerfRawData_TeradiciPerf_PCoIPSessionGeneralStatistics -Property SessionDurationSeconds

Best regards

0 Kudos
1 Solution

Accepted Solutions
mpryor
Commander
Commander
Jump to solution

> is it possible to detect inside user VM that user has connected or reconnected to his desktop and run some script ?

You can run scripts as the user on login and reconnect, this has been a feature since 3.0. See Running Commands on View Desktops.

> Also is it possible inside user VM to find out if user is connected and how long?

I don't think we expose this, but you should be able to query Windows for login time or you could write the last connect time with a script (perhaps this is the reason for your first question?).

Mike

View solution in original post

0 Kudos
2 Replies
mpryor
Commander
Commander
Jump to solution

> is it possible to detect inside user VM that user has connected or reconnected to his desktop and run some script ?

You can run scripts as the user on login and reconnect, this has been a feature since 3.0. See Running Commands on View Desktops.

> Also is it possible inside user VM to find out if user is connected and how long?

I don't think we expose this, but you should be able to query Windows for login time or you could write the last connect time with a script (perhaps this is the reason for your first question?).

Mike

0 Kudos
Najtsob
Enthusiast
Enthusiast
Jump to solution

That is exactly what I was looking for.

Thank you Smiley Happy

0 Kudos