Profile picture for user jordanjt95

Hi ,

I'm trying to get all the database user's last active sessions informations from the Aris Administration.

There is a field called "Active Sessions", but it is only reporting users that are logged into the database if I'm correct.

There is another field called "History", and this one is empty.

Does someone know how I can retrieve, by using report scripting, the last active session (date and time) for all the users assigned to a specific database ?

by Willem Engelbrecht
Posted on Wed, 11/24/2021 - 09:18

Hi Jordan,

Please see the attached script, I have not used it in a long time, but maybe it can help. I exported it from a server running ARIS10 SR15, but if you struggle to import, let me know, and I will paste the code in a follow-up.

Regards,

Willem

0
by Runé Becker
Badge for 'Mastermind' achievement
Posted on Wed, 11/24/2021 - 09:52

If it's only about the number of user logins you could use the exportable statistics of User management available via /#default/adminUsers and there on Additional functions/Export user statistics.

You choose a start and end date and as event type Login successful to get a CSV file with the timestamps and the user names, such as:

time;"eventType";"node";"executorLogin";"executorIp";"expiry";"sessionId";"sessionType"            
2021-11-19 14:15:57;"LOGIN_SUCCESSFUL";;"[peter.process]";"193.26.202.162";"2021-11-19 15:15:57";"[ddb6d6788ac1e42bc55ed8282e137377]";"[UMC]"
2021-11-19 14:04:35;"LOGIN_SUCCESSFUL";;"[eric.employee]";"193.26.202.162";"2021-11-19 15:04:35";"[6294768663ce59aaa62d834b5f30ae79]";"[UMC]"
2021-11-19 13:43:59;"LOGIN_SUCCESSFUL";;"[danny.designer]";"193.26.202.162";"2021-11-19 14:43:59";"[b13b062997f15669778dacbb5669f59e]";"[UMC]"
2021-11-04 21:00:14;"LOGIN_SUCCESSFUL";;"[amy.architecture]";"193.26.202.162";"2021-11-04 22:00:14";"[602f9b9852d8c2a800d67a848721f1bf]";"[UMC]"
2021-11-04 20:40:38;"LOGIN_SUCCESSFUL";;"[danny.designer]";"193.26.202.162";"2021-11-04 21:40:38";"[5f494adbefa24059e66db1dafa147677]";"[UMC]"
2021-11-04 20:21:08;"LOGIN_SUCCESSFUL";;"[danny.designer]";"193.26.202.162";"2021-11-04 21:21:08";"[afc0a2a067f674d1f35bb555ff979a30]";"[UMC]"
2021-11-03 11:23:43;"LOGIN_SUCCESSFUL";;"[eric.employee]";"193.26.202.162";"2021-11-03 12:23:43";"[9a1cb45e9c210638ed8d3cc6886b91ab]";"[UMC]"
2021-11-03 11:19:29;"LOGIN_SUCCESSFUL";;"[danny.designer]";"193.26.202.162";"2021-11-03 12:19:29";"[952f12c6bbfe7babb950c591a403fee6]";"[UMC]"

Cheers
Rune

0
by Jordan Tangy
Badge for 'Question Solver' achievement
Author
Posted on Wed, 11/24/2021 - 12:16

In reply to by rbe

Hey Rune,

Thanks for your answer.

Actually I'm in interested in the last login date of each user on a specific database and not the number of users who logged in as you said.

I did what you said but I got an Excel file with only users first/last name and permissions. No infos about login.

Cheers

0
by Veronika Ellermann
Badge for 'Fan' achievement
Posted on Thu, 11/25/2021 - 12:04

Hi Jordan,

In the User Management of Connect there is a functionaliy called Additional functions ==> Export user Statistics. 

Here you can search for "login successful" and select the "from- until" dates and export the statistics.

Hope this helps.

Best,

Veronika

0
by Jordan Tangy
Badge for 'Question Solver' achievement
Author
Posted on Sun, 11/28/2021 - 15:24

In reply to by Vee_ARIS

Hi Veronika,

Thank you for your answer.

What I meant is that I need to retrieve the last active session of each user with a report. I looked for functions on Aris script that would help me get this but I didn't find any.

If you know more on the subject, I'd like to know.

Thank you !

0
by Willem Engelbrecht
Posted on Wed, 01/12/2022 - 08:42

Hi, Please see the code below. When creating the script, make sure you select to run it from a group and that you can open dialogs, output is to Excel. Run the script from the "Main group".

var LNG = Context.getSelectedLanguage();
var AD = ArisData.getActiveDatabase();
var AF = AD.ActiveFilter();
var currentDate = new Date();
var minutes = currentDate.getMinutes();
var allGroups = new Array();
var selDBSName = AD.Name(LNG);
var selGroupName = ArisData.getSelectedGroups()[0].Name(LNG);
var modsinGroup = new Array();
var userName = "";
var gUsers = AD.UserList();
var UsersL = new Array();

//////////////////////////////////////
function main()
{
    for (var n = 0; n < gUsers.length; n++) {
        var uName = gUsers[n].Name(LNG)
        if (uName == "guest" || uName == "arisservice" || uName == "superuser") {
            continue;
        } else {
            UsersL = UsersL.concat(uName);
            
        }
    }
    UsersL = UsersL.sort();
    var userdialogUserName = Dialogs.createNewDialogTemplate(150, 50, "User name");

    userdialogUserName.Text(10, 10, 100, 15, "Select User Name:");
    userdialogUserName.ComboBox(10, 30, 170, 15, UsersL,"sSelectedItem");
    
    userdialogUserName.OKButton();
    userdialogUserName.CancelButton();
    
    var dlgIG = Dialogs.createUserDialog(userdialogUserName);
    userdialogUserName = Dialogs.show( __currentDialog = dlgIG);
    if (userdialogUserName == 0) {
      return;
    }
    var userNr = dlgIG.getDlgSelection("sSelectedItem");
    userName = UsersL[userNr];
    var groups = ArisData.getSelectedGroups();
    var modelList = ArisData.getSelectedModels();
    
    for (var a=0;a<groups.length;a++) {
        var group = groups[a];
        allGroups = allGroups.concat(groups[a]);
        var childGroups = group.Childs(true);
        if (childGroups.length > 0) {
            for (var c = 0; c < childGroups.length; c++) {
                allGroups.push(childGroups[c]);
            }
        }   
    }
       
    createReport(userName);
}
/////////////////////////////////
function createReport(userName)
{
    var fileName = "Last updates by " + userName;
    var extension = ".xlsx";
    OUTEXCEL = Context.createOutputObject(Context.getSelectedFormat(), fileName + " in " + selDBSName + "-" + selGroupName + extension);
    OUTEXCEL.Init(LNG);
    OUTEXCEL.DefineF("NORMAL", "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT | Constants.FMT_VTOP, 0, 1, 0, 0, 0, 1);
    OUTEXCEL.DefineF("TABLE_HEAD_GREY", "Arial", 9, Constants.C_BLACK, Constants.C_GREY_80_PERCENT, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VCENTER, 0, 0, 0, 0, 0, 1);
    
    InitStatusReport();
    getAttribs();
    
    OUTEXCEL.EndTable("Attributes", 100, "Arial", 12, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
    OUTEXCEL.WriteReport();
}
////////////////////////////////
function InitStatusReport()
{
    OUTEXCEL.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0);
    OUTEXCEL.TableRow();
    OUTEXCEL.TableCellF("User Name", 50, "TABLE_HEAD_GREY");
    OUTEXCEL.TableCellF("Model Name", 50, "TABLE_HEAD_GREY");
    OUTEXCEL.TableCellF("Model Type", 50, "TABLE_HEAD_GREY");
    OUTEXCEL.TableCellF("Date changed", 50, "TABLE_HEAD_GREY");
    //OUTEXCEL.TableCellF("Hieracrhy Number", 20, "TABLE_HEAD_GREY");
    //OUTEXCEL.TableCellF("Rule Type", 50, "TABLE_HEAD_GREY");
}
////////////////////////////////
function getAttribs()
{
    
    allGroups = ArisData.sort(allGroups, Constants.AT_NAME, LNG);        
    for (var z = 0; z < allGroups.length; z++) {        
        var grp = allGroups[z];
        
    modelList = grp.ModelList();
        modelList = ArisData.sort(modelList, Constants.AT_NAME, LNG);
    
    
    for (var b = 0; b < modelList.length; b++) {
            var aModel = modelList[b];
            var user = aModel.Attribute(Constants.AT_LUSER, LNG).getValue();
            if (user == userName) {
                var aName = user;
                var aModName = aModel.Attribute(Constants.AT_NAME, LNG).getValue();
                var aType = aModel.Type();
                var aDate = aModel.Attribute(Constants.AT_LAST_CHNG_2, LNG).getValue();

            WriteReportLine(aName, aModName, aType, aDate);
            }
        }
    }
}
////////////////////////////////
function WriteReportLine(aName, aModName, aType, aDate) //, oTXCode, oDesc)
{
    OUTEXCEL.TableRow();
    OUTEXCEL.TableCellF(aName, 50, "NORMAL");
    OUTEXCEL.TableCellF(aModName, 50, "NORMAL");
    OUTEXCEL.TableCellF(aType, 50, "NORMAL");
    OUTEXCEL.TableCellF(aDate, 50, "NORMAL");
    //OUTEXCEL.TableCellF(aHierArch, 20, "NORMAL");
    //OUTEXCEL.TableCellF(oRuleType, 50, "NORMAL");
}
////////////////////////////////
main();

 

Hope it helps.

Regards,

Willem

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock