VMware Horizon Community
Travis_83
Enthusiast
Enthusiast
Jump to solution

VMWare Horizon View Events (User Login History) how to source from (sql) database

hi guys,

our view console wont show all the event for a particular user, trying to get last 4 weeks.

any sql query i can run on composer db to generate this info?

or cli.

thanks,

travis

1 Solution

Accepted Solutions
BenFB
Virtuoso
Virtuoso
Jump to solution

Make sure you leave the % on each side of the username. So it's '%Travis_83%' as an example.

View solution in original post

Reply
0 Kudos
8 Replies
BenFB
Virtuoso
Virtuoso
Jump to solution

You can run the following query against the SQL database. Make sure to replace DATABASENAME with the name of your view events database.

SELECT [EventType]

      ,[ModuleAndEventText]

      ,[Time]

      ,[Source]

      ,[Severity]

      ,[Node]

      ,[DesktopId]

  FROM [DATABASENAME].[dbo].[VE_event]

  order by Time DESC

Replace USERNAME with the username of the user and this will show all events for the user.

SELECT [EventType]

      ,[ModuleAndEventText]

      ,[Time]

      ,[Source]

      ,[Severity]

      ,[Node]

      ,[DesktopId]

  FROM [DATABASENAME].[dbo].[VE_event]

  where [ModuleAndEventText] like '%USERNAME%'

  order by Time DESC

This will show all events with a severity of error.

SELECT [EventType]

      ,[ModuleAndEventText]

      ,[Time]

      ,[Source]

      ,[Severity]

      ,[Node]

      ,[DesktopId]

  FROM [DATABASENAME].[dbo].[VE_event]

  where [Severity] like '%ERROR%'

  order by Time DESC

Travis_83
Enthusiast
Enthusiast
Jump to solution

Sorry, but these commands for username return nothing.

Reply
0 Kudos
BenFB
Virtuoso
Virtuoso
Jump to solution

I've been using these queries successfully since Horizon 5.x and confirmed they work on 7.x. Can you share what you are trying?

Reply
0 Kudos
Travis_83
Enthusiast
Enthusiast
Jump to solution

So the username one, i change DB name and event is slightly different.

where is says '%username%' i replace with user of concern and run query but nothing.

says completed, no error..

im looking for logon events for this user, there are some so would expect some results...

Reply
0 Kudos
BenFB
Virtuoso
Virtuoso
Jump to solution

Make sure you leave the % on each side of the username. So it's '%Travis_83%' as an example.

Reply
0 Kudos
Travis_83
Enthusiast
Enthusiast
Jump to solution

thanks, i couldnt get it to work with username so used USERSID instead.

Reply
0 Kudos
BenFB
Virtuoso
Virtuoso
Jump to solution

My mistake, I see the issue and I've corrected it above.

The filter was searching [Severity] instead of [ModuleAndEventText]. Please give it another try.

Reply
0 Kudos
Travis_83
Enthusiast
Enthusiast
Jump to solution

no worries Ben, got what I wanted in the end USERSID worked just aswell.

Reply
0 Kudos