Enthusiast
Enthusiast

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

Jump to solution

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

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

View solution in original post

0 Kudos
8 Replies
Commander
Commander

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

Enthusiast
Enthusiast

Sorry, but these commands for username return nothing.

0 Kudos
Commander
Commander

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?

0 Kudos
Enthusiast
Enthusiast

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

0 Kudos
Commander
Commander

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

View solution in original post

0 Kudos
Enthusiast
Enthusiast

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

0 Kudos
Commander
Commander

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.

0 Kudos
Enthusiast
Enthusiast

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

0 Kudos