Smart Client IpAddress

Is it possible to get the IpAddress of a Smart Client when an action is performed on a Map by right mouse click in function TriggerReceiver ?

For an item , I fill the ContextMenu with several actions but when the action is triggered I want to get the IpAddress of the machine where the Smart Client is running.

How can I do it ?

Thanks

No, it is not possible to get the Smart Client IP address, user or other information about who trigged it, unfortunately.

Ok. If I cannot obtain the IpAddress, is it possible to get the Credential name of the Smart Client that trigger the action from the map ?

Or another parameter that will allow me to distinguish each Smart Client ?

Thanks

I Have seen that the ObjectIdString in the Sender object parameter of TriggerReceiver function is always the same for a particular user.

When I log with User1 the value is “S-1-9-2374562217-2721758136-3113234502-2229721912-3584831178-1-3935514346-1709544261-2723447933-98315490” and when I log with User2 the value is “S-1-9-2374562217-2721758136-3113234502-2229721912-3584831178-1-4103734747-1618369346-2496272944-4207760840”.

So perhaps I have the means to distinguish the Trigger command from 2 different users ?

Do you know how this ObjectIdString is built ?

It’s very important for me to be able to solve this problem otherwise it calls into question my whole project

Thanks

Please see Config API Client sample which shows you user information, please see below picture -

https://doc.developer.milestonesys.com/html/index.html?base=samples/configapiclient.html&tree=tree_2.html

So this value is the SID of each User.

In a plugin integration mode, how can I get this SID in the server ?

Thanks

It is possible to use the Configuration API and use the same code in Plugin Integration.

PS. It is often easier to use the strongly typed classes compared to using the Configuration API directly. Try this snippet of code:

 private void GetUsers()
{
        ManagementServer mgt = new ManagementServer(EnvironmentManager.Instance.MasterSite.ServerId);
        var roles = mgt.RoleFolder.Roles;
        foreach (var role in roles)
        {
                 label1.Text += $"Role: {role.Name} " + System.Environment.NewLine;
                 foreach (var user in role.UserFolder.Users)
                 {
                          label1.Text += $"User: {user.DisplayName} SID {user.Sid} " + System.Environment.NewLine;
                  }
        }
}

Thanks. That’s very useful for me.