IAuditLogons.Session

Syntax

Session: Integer;

Description

The Session property returns session key.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    ALogon: IAuditLogons;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Open access protocol
    Al := MS.OpenAuditLog;
    ALogon := AL.OpenLogons(
False);
    
// Display to console information about current repository sessions
    While Not ALogon.Eof Do
        Debug.WriteLine(
"Session: " + ALogon.Session.ToString);
        Debug.WriteLine(
"User: " + ALogon.UserName + "; Description: " + ALogon.UserDescription + "; Sid: " + ALogon.UserSid);
        Debug.WriteLine(
"Workstation: " + ALogon.Station + "; OS user: " + ALogon.UserOS + "; IP: " + ALogon.UserIP);
        ALogon.Next;
    
End While;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the information about the sessions with the current repository is displayed in the development environment console. The following information will be displayed: session key; name, description and SID (security subject identifier) of the user, under whom platform connection was established. And also a name of the workstation, the user name under which the entry to the operating system was done and IP of the workstation are displayed.

See also:

IAuditLogons