VMware Horizon View(ConnectionServer)でユーザーの最大接続数をPowerCLIで表示する

VMware Horizon Viewの環境で、ユーザーの最大接続数をWindowsPowerShellを利用してテキストに出力する事ができます。


例えば、利用者が不足しているのかどうかを判断するのに日々、統計をとる事でライセンスを追加する必要があるかどうかを判断できます。


そして、コマンド自体は、コネクションサーバーにログイン後、PowerShellを起動して、以下のコマンドを実行する事で確認する事ができます。


①コネクションサーバにログインする
PowerShellを起動する
③以下のコマンドを実行する
>Add-PSSnapin vm*

④以下のコマンドを実行します。
>Get-EventReport -viewName user_count_events


ただ、これだけだと情報が多すぎて分かりにくいので、必要な項目だけ表示するなんてこともできます。


参考にしたのは以下のブログです。

>>Display the maximum concurrent connected users in VMware Horizon View with PowerCLI

The following command displays the concurrent users from the last 5 days:

Get-EventReport -viewName user_count_events -startDate *1 | sort time | Select Time,Usercount


日付の指定がありますが、以下のように指定する事で、イベントタイプ、時間、Usercountで絞る事ができます。

>Get-EventReport -viewName user_count_events  | sort time | Select eventtype,time,usercount


必要な情報をパイプとsortを利用する事でコマンドで出力する事ができます。


また、以下の情報からも分かりますが、VMware Horizon Viewは、深夜の5分前に日々のユーザー接続に関するイベントを生成します。

VMware Horizon View generates everyday at 5 minutes  for midnight an event how many concurrent users connected to View that day. This information can be useful for example when when investing trends.


そして、ブログにあるようにコマンドを少し変える事で、出力させたい情報だけに絞る事もできます。

 

 

*1:Get-Date).AddDays(-5