VMWare View, how to count active sessions

Today I needed to track the number of active sessions of a given virtual desktop pool in my VMWare View infrastructure. VMWare offers some cmdlets to Powershell integration; you can find them on the server where the Connection Server is installed: You can include those cmdlets in your scripts with the command: add-PSSnapin "VMware.View.Broker"add-PSSnapin "VMware.View.Broker" To get remote sessions, use Get-RemoteSession cmdlet,…

Powershell, how to get parameters from a file

I wrote the following snippet when a friend asked me some help: he needed to execute a command several times, getting its parameters from a CSV (comma-separated values) file. the parameters.csv file contains the following informations: IP address username password Here’s the script: $file = Get-Content "C:\parameters.csv"   foreach($row in $file) {   $parameters = $row.Split(","); $ipaddress = $parameters[0]; $username…