Link to home
Create AccountLog in
Avatar of gogetsome
gogetsomeFlag for United States of America

asked on

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!
Avatar of mgcIT
mgcIT
Flag of United States of America image

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
    Next

    'Change the file name and path as desired
    excBook.SaveAs "T:\log.xls"
    excBook.Close
    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?
Avatar of gogetsome

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of mgcIT
mgcIT
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer