Brian Madden Logo
Your independent source for application and desktop virtualization.
advertisement

Session Count On Citrix Application, in the Scripting / Automation forum on BrianMadden.com

rated by 0 users
This post has 0 Replies | 1 Follower

Not Ranked
Points 175
Anurag Goswami Posted: Thu, Dec 11 2008 3:47 AM

Hi,

I am using below script to get session on Citrix Farm but below script is giving me servername, user name and application name.

Can someone modify below script as I want information total no. of users connected on an application and that application is running on which server.

For Ex. : If notepad application is running on CTXServer1 then it would show information:

Server : CTXServer1

Application : Notepad

Total No. Of Users : 20

Script:

Const cMetaFrameWinFarmObject = 1
Const MFSessionStateActive = 1
Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
theFarm.Initialize(cMetaFrameWinFarmObject)
intSessionCount = 0
intActiveCount = 0
For Each oSession In theFarm.Sessions
    intSessionCount = intSessionCount + 1
    If (oSession.SessionState = MFSessionStateActive) and (oSession.SessionName <> "Console") Then
        intActiveCount = intActiveCount + 1
'        WScript.Echo vbcrlf & "*****************************"
        WScript.Echo oSession.UserName & "          " & oSession.ServerName & "          " & oSession.AppName
    End If
Next
WScript.Echo "Total Session Count = " & intSessionCount & vbcrlf & "Active Session Count = " & intActiveCount

 

Thanks.

Anurag

  • | Post Points: 5
Page 1 of 1 (1 items) | RSS