Hello community,
When connecting to DataMiner via cube or accessing a Low-Code App, an information event is generated telling the username and the hostname/IP where the connection originated from:
Is it possible to obtain that hostname/IP via an automation script? Perhaps through the usage of UserCookie Property UserCookie | DataMiner Docs?
Thank you!
Hi Sebastian,
I didn't try but you can use the code snippet available in this question:
QAction – How to validate if a user from a specific dma group clicked on a button?
The code snippet is for a QAction, but the SLNet call can be used in a script to retrieve the information that you are looking for. The user instance contains the property 'LastLoginFrom', which contain the hostname.
Hope it helps.
That worked! Thank you, Miguel.
For those interested on how to do it here is a sample code
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages;
public class Script
{
public void Run(Engine engine)
{
var securityInfo = (GetUserInfoResponseMessage)engine.SendSLNetSingleResponseMessage(new GetInfoMessage(InfoType.SecurityInfo));
var user = securityInfo.FindUserByFullName(engine.UserDisplayName);
engine.GenerateInformation($”{user.LastLoginFrom}”);
}
}