VMware Horizon Community
MaxStr
Hot Shot
Hot Shot
Jump to solution

How to see when user last logged on?

I'm trying to clean up some persistent VDI, and I need to see when was the last time the user logged in. Is this possible in the Horizon interface?

Reply
0 Kudos
1 Solution

Accepted Solutions
NxN_Slite
Enthusiast
Enthusiast
Jump to solution

If the users as only access to VDI you could use the AD powershell query to find it.

Get-ADUser -Identity “username” -Properties “LastLogonDate”

(You could add some flavor to check all members of a group)

you could also open the admin$ and check at timestamp of the user in the VMs

You could also use Vcrop if you do have it. it does metric that.

Finally you could query the Horizon View DB directly following this link

VMware Knowledge Base

Good luck and have a great day.

View solution in original post

6 Replies
NxN_Slite
Enthusiast
Enthusiast
Jump to solution

If the users as only access to VDI you could use the AD powershell query to find it.

Get-ADUser -Identity “username” -Properties “LastLogonDate”

(You could add some flavor to check all members of a group)

you could also open the admin$ and check at timestamp of the user in the VMs

You could also use Vcrop if you do have it. it does metric that.

Finally you could query the Horizon View DB directly following this link

VMware Knowledge Base

Good luck and have a great day.

NathanosBlightc
Commander
Commander
Jump to solution

Execute the following query in the SQL management studio to retrieve information about last logged on users from VMware Horizon View Event database: 

SELECT a.ModuleAndEventText,a.Time
FROM event_historical a
INNER JOIN
(SELECT ModuleAndEventText,
MAX(Time) as Time
FROM event_historical
GROUP BY ModuleAndEventText
) AS b
ON a.ModuleAndEventText = b.ModuleAndEventText
AND a.Time = b.Time
WHERE EventType = 'Agent_CONNECTED';

Please mark my comment as the Correct Answer if this solution resolved your problem
MaxStr
Hot Shot
Hot Shot
Jump to solution

Who keeps marking posts as answered after a few hours? Well obviously it's the mods, but I would have marked it myself.  You guys need to give it a few (week)days, some of us don't work on weekends

Raresch
Contributor
Contributor
Jump to solution

I do not think the Solution is ok, if I log on another System over AD that does not mean i have used my VDI.

CTRIM
Enthusiast
Enthusiast
Jump to solution

Exactly correct. Authenticating to AD is not using VDI. So the marked solution is wrong.

Reply
0 Kudos
Raresch
Contributor
Contributor
Jump to solution

I am using the Horizon event DB to see the last Log on of  any VDI, we are running huge GPU environments and need to be abele to see  witch users are using the VDIs and witch not, we can then power down the vdi and use the Resources for other users. Last log on over AD is not ok

Reply
0 Kudos