• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

users table?

Hello, I want to create an asp.net application that will allow admins to quickly logoff a sekected user. Basically, the functionality of the management console when you right click a user and logoff the selected session.
Does Citrix store these sessions in a data table somewhere? Is is accessable?

Any help would be great!
  • 3
1 Solution
yes... stored in the DB.  Here's a VB script that reads from this DB that was created to pull some info into an excel file for logging.  I'm not sure how to log users off but this will at least give you access to the DB:

On Error Resume Next

'Dim excApp As Object, _
    'excBook As Object, _
    'excSheet As Object, _
    'intRow As Integer    

    Set excApp = CreateObject("Excel.Application")
    Set excBook = excApp.Workbooks.Add()
    Set excSheet = excBook.ActiveSheet
    excApp.DisplayAlerts = False
    Set farm = CreateObject("MetaframeCOM.MetaframeFarm")
    farm.initialize 1

    excSheet.Cells(1, 1) = "Application Name"
    excSheet.Cells(1, 2) = "Server Name"
    excSheet.Cells(1, 3) = "User Name"
    excSheet.Cells(1, 4) = "Logon Time"

    intRow = 2
    For Each session in farm.sessions
        Set Logon_Time=Session.LogonTime(True)
         Session_Connected=Logon_Time.Month&"/"&Logon_Time.day&"/"&Logon_Time.Year&" "&Logon_Time.Hour&":"&Logon_Time.Minute

        'If session.sessionstate=Active Then     'Track Active Sessions only
            excSheet.Cells(intRow, 1) = session.appname
            excSheet.Cells(intRow, 2) = session.ServerName
            excSheet.Cells(intRow, 3) = session.UserName
            excSheet.Cells(intRow, 4) = Session_Connected
            intRow = intRow + 1
        'End if

    'Change the file name and path as desired
    excBook.SaveAs "T:\log.xls"
    Set excSheet = Nothing
    Set excBook = Nothing
    Set excApp = Nothing
    Set farm = Nothing

Wscript.Echo "DONE"
just curious though, why don't you want to use the CMC?
gogetsomeAuthor Commented:
Thanks mgcIT for responding. Where is the DB located and the name? What type of DB is it; SQL?

I built an Intranet applicaiton and have a dashboard for admins to quickly perform some mondane tasks, such as kicking users out of Great Plains, unlocking accounts... Often in our environment we have to log the user out of citrix too. Which takes several clicks to get the job done. For example, with the dashboard I have the great plains logout with just 2 clicks. One to populate a grid and one to logoff the user. I'm looking to do the same with the Citrix session as well.
the default database type is MS Access but it could be SQL or Oracle also.  If you went with the default it will be located at

C:\Program Files\Citrix\Independent Management Architecture\mf20.mdb

all servers will have a local copy (LHC or Local Host Cache) of this file called imalhc.mdb but only your data store will have the mf20.mdb file.  Be careful though as this database holds all the info for your farm.

if you set up citrix to use an SQL or oracle DB it would be on the database server that you specified originally.

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now