Exporting current logged on user

Started by JoCriSem, May 25, 2020, 11:13:02 AM

Previous topic - Next topic

JoCriSem

Hi, is there a way to export the current logged on Windows user to a variable so that info can be used in a "created by" note on a view?
Quite a newbie in JS and jArchi.

Txs.

Jean-Baptiste Sarrodie

Hi,

You can get the current logged in user through java.lang.System:

var System = Java.type('java.lang.System');
console.log(System.getProperty("user.name"));


Regards,

JB
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

JoCriSem