LESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/typography.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/template.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/responsive.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/k2.less

Follow Me Icons

 

Follow @KendrickColeman on TwitterConnect on LinkedInWatch My Videos on YouTubeFollow me on FacebookCheck Out My Projects on GitHubStay Up To Date with RSS

Search

BSA 728x90 Center Banner

VMware View PowerCLI Active Session Count

I'm just throwing a quickie out there...

 

I originally wanted to create a small ruby or python script that collected the Active Number of View Sessions currently running for a small project we are running internally. Come to find out, there isn't an API available for VMware View (TBD documentation for Horizon 6) so I had to rely on Powershell to do this for me.

 

I'm sure there are PS gurus out there that will tell me they can condense this down to a single line, but that's not how my brain works.

 

Download ViewActiveSessionCount.ps1

 

#Add the VMware View powershell snapin
Add-PSsnapin VMware.View.Broker
#Set the connection broker to check. This isn't used since the commands are run locally
$ConnectionServer = "localhost"
#For loggin create a timestamp
$TimeStamp = Get-Date -format yyyy-MM-dd-H-mm
#grab an array of remote sessions
$ActiveConnections = Get-RemoteSession -State CONNECTED
#set initial count to 0
$i = 0
#do some counting
if ($ActiveConnections -eq $NULL){
Echo "there are $i active connections"
}
else{
foreach ($ActiveConnection in $ActiveConnections){
$i++
}
Echo "there are $i active connections"
}
#Add it to a logfile
$row = $TimeStamp + "," + $i + " Active Sessions"
$row | Out-File -FilePath "c:\check-active-sessions.log" -Append

Related Items

LESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/blue.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/green.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/orange.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/purple.less