users table?

Posted on 2006-03-29
Last Modified: 2008-02-01
Hello, I want to create an 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!
Question by:gogetsome
    LVL 18

    Expert Comment

    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.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"
    LVL 18

    Expert Comment

    just curious though, why don't you want to use the CMC?

    Author Comment

    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.
    LVL 18

    Accepted Solution

    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

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    #Citrix #XenApp #Citrix XenApp #Citrix Concurrent License #Citrix Licensing #Citrix Policies
    #Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
    How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now