|
<< Click to Display Table of Contents >> Navigation: Telegram > 2021 > 02 > 11 > Telegram_2021-02-11T16 |
2021-02-11T16:23:48
Not sure if LOGON_USER will give you that.
Anyway, you need to add LOGON_USER to the list of server variables in your ServerController before trying to read its value. ServerVariables is a public (not published) property so it is not visible in Object Inspector.
In your SErverController.OnConfig event do:
ServerVariables.Add('LOGON_USER');
Then you can read it through:
WebApplication.Request.GetServerVariableValue('LOGON_USER');
2021-02-11T16:24:30
IMO you should first try the standard way of getting the Windows user for your process. It should give you the account name of the user that IIS used to impersonate when loading the process
2021-02-11T16:24:57
Read what MS says about LOGON_USER here:
type: link https://docs.microsoft.com/en-us/iis/web-dev-reference/server-variables
2021-02-11T16:25:42
if you are going through windows logged in user name, you can try one of these:
type: link https://stackoverflow.com/questions/17599086/how-to-get-currently-logged-in-username