VMware Horizon Community
Jgordon_6866
Contributor
Contributor

How do i get a log of the last time an entitled user logged into the VDI environment

ok so this seemed like a pretty easy request

management has as me to find out 3 things

1: list of all entitled users as they appear within view administrator

2: last time the entitled users logged into the VDI environment

3: list of entitlements per user

i swear i saw something on this but i cant find it now sorry if this is redundant

my search for any information on this seems to be a dead end or i don't know what to search for

i would like to find a powercli script or tool that would allow me to do this

i'm not the best with powershell/powercli but i can figure it out if someone points me in the right direction

our current environment consists of a dedicated vm-ware environment for VDI, Horizon 7.0

AD integrated

1 v-center server

6 esxi hosts for VDI

14 Desktop pools

and about 500 entitled users in those pools

there has been no maintenance on the Horizon side of thins for a long time no its my job to clean up stuff

currently some of my desktop pools have 50 or more entitled users but only 3-5 active sessions

AD has been cleaned up and inactive users have been dealt with but there were a lot of users assigned manually within the desktop pools hence the request

if i could find a way to see who has not logged on in say 60 days and the entitlements they havae that would help a lot to sort out this mes

thanks

James Gordon

0 Kudos
5 Replies
BenFB
Virtuoso
Virtuoso

You have a few options with drawbacks that I'll list below.

  1. You can log directly in to Horizon Administrator and search events. This only shows the 2,000 most recent events and can be slow but works for one offs.
  2. Query the events SQL database. Unless you have the ability to use SQL reporting and build a dashboard this is good for one offs.
  3. Syslog/write connection servers logs to a file and query those. This would be my preferred choice if you already have logging infrastructure in place with an easy way to review/search/build reports.
0 Kudos
JohnTwilley
Hot Shot
Hot Shot

Here's an easy way to do the SQL query...

Horizon View Events Database Export Utility

https://labs.vmware.com/flings/horizon-view-events-database-export-utility

0 Kudos
Jgordon_6866
Contributor
Contributor

Thanks guys for all the great answers

im going to look into both options and see which one works best for me   im not an sql guy so this might be interesting

thanks

James Gordon

0 Kudos
sjesse
Leadership
Leadership

Another option is powercli if your famialr with it

$connectionServer=Connect-HVServer -Server $hvserver -User $hvuser -Password $hvPassword -Domain $hvDomain

$Services1=$connectionServer.ExtensionData

$eventdb=Connect-HVEvent -DbPassword $eventDbPassword

$events=Get-HVEvent -HvDbServer $eventdb -TimePeriod week -UserFilter $userName

$events.events

This will output a list of all events for that user, you would just need to add the correct settings for the variables. This require the vmware.hv.helper I believe

PowerCLI-Example-Scripts/Modules/VMware.Hv.Helper at master · vmware/PowerCLI-Example-Scripts · GitH...

and I based this code of the work done in

https://www.retouw.nl/checks/using-powercli-to-get-horizon-view-status-events/

I think this is easier that running sql queries, and I'm going to setup alerts based on this, currently we are doing an sql job for this.

0 Kudos
SKUNCHAL
Contributor
Contributor

Login to the Horizon Connection server and launch CMD as an administrator and Run the command as "vdmadmin -O"

Tags (1)
0 Kudos