VMware Horizon Community
dzak64
Enthusiast
Enthusiast

Script to list maximum sessions per day

I am trying to create a script (PowerCLI) to list the total maximum concurrent sessions connected to Horizon per day for the last 7 days.

Horizon 7.1 Standard, 4 connection servers.

I found the following, but it doesn't appear to reflect what I'm seeing in the Horizon Administrator:

Get-EventReport -viewName user_count_events -startDate ((Get-Date).AddDays(-7)) | sort time | Select Time,ccucount

time                                    ccucount                              

----                                    --------                              

2017-05-23 23:55:01.653                                                       

2017-05-23 23:55:01.653                                                       

2017-05-23 23:55:01.653                                                       

2017-05-23 23:55:01.653                 369                                   

2017-05-24 23:55:01.293                                                       

2017-05-24 23:55:01.297                                                       

2017-05-24 23:55:01.297                                                       

2017-05-24 23:55:01.297                 367                                   

2017-05-25 23:55:01.66                                                        

2017-05-25 23:55:01.66                                                        

2017-05-25 23:55:01.66                                                        

2017-05-25 23:55:01.66                  368                                  

Anyone has a better (or correct) way of creating this report?

Thanks,

Dan

2 Replies
dmuligan
Enthusiast
Enthusiast

Probably using this tool:

Horizon Toolbox 2

ningzige
Contributor
Contributor

Try the following and you'll get what you want.

Get-EventReport -viewName user_count_events -startDate ((Get-Date).AddDays(-7)) | Where-Object eventtype -match "BROKER_DAILY_MAX_CCU_USERS" | sort time | Select Time,ccucount