Name DataType Subtype Length MetaFrameFarm Automation 'Citrix MetaFrame COM Library'.MetaFrameFarm MetaFrameWinFarm Automation 'Citrix MetaFrame COM Library'.IMetaFrameWinFarm6 IMetaFrameSessions Automation 'Citrix MetaFrame COM Library'.IMetaFrameSessions IMetaFrameSession Automation 'Citrix MetaFrame COM Library'.IMetaFrameSession SessionCounts Integer i Integer IF ISCLEAR(MetaFrameFarm) THEN CREATE(MetaFrameFarm); MetaFrameFarm.Initialize(1); MetaFrameWinFarm := MetaFrameFarm.WinFarmObject; if MetaFrameWinFarm.IsCitrixAdministrator = 0 then error('Not an Citrix Admin ;-('); IMetaFrameSessions := MetaFrameFarm.Sessions; SessionCounts := IMetaFrameSessions.Count(); MESSAGE(FORMAT(SessionCounts)); FOR i := 0 TO SessionCounts-1 DO BEGIN IMetaFrameSession := IMetaFrameSessions.Item(i); MESSAGE('USER %1\ClientName %2\ClientAddress %3', IMetaFrameSession.UserName, IMetaFrameSession.ClientName, IMetaFrameSession.ClientAddress); END; clear(MetaFrameFarm);
variables Name DataType Subtype Length WTSManager Automation 'WTSManager Library'.Shell Counts Integer i Integer IP Variant ClientName Variant IF ISCLEAR(WTSManager) THEN CREATE(WTSManager); Counts := WTSManagerP.ClientCount; FOR i := 1 TO Counts DO BEGIN WTSManager.Refresh(); IP := WTSManager.Clients(i).IPAddress; WTSManager.Refresh(); ClientName := WTSManager.Clients(i).ClientName; IF (FORMAT(IP) <> '') THEN BEGIN MESSAGE('IP = %1\Clientname = %2',IP,ClientName); //LogOnUsers.INIT; //LogOnUsers."Report ID" := i; //LogOnUsers."Client IP" := IP; //LogOnUsers."Client Name" := ClientName; //LogOnUsers.INSERT; END; END; CLEAR(WTSManager);