MaxStr
Enthusiast
Enthusiast

How to see when user last logged on?

Jump to solution

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?

0 Kudos
1 Solution

Accepted Solutions
NxN_Slite
Enthusiast
Enthusiast

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

4 Replies
NxN_Slite
Enthusiast
Enthusiast

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

NathanosBlightc
Commander
Commander

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
Enthusiast
Enthusiast

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

0 Kudos
Raresch
Contributor
Contributor

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.

0 Kudos