UserIP: String;
The UserIP property returns the IP-address of the computer from which the connection to the repository was established.
Sub Main;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
AL: IAuditLog;
ALogon: IAuditLogons;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
Al := MS.OpenAuditLog;
ALogon := AL.OpenLogons(False);
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;
End Sub Main;
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: the number of the session; name, description and SID (security subject identifier) of the user, under which the connection to the platform was performed. 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: