Query report to extract Active Technician Login and IP Address (MSSQL & PGSQL)

Query report to extract Active Technician Login and IP Address (MSSQL & PGSQL)

Tested in builds PGSQL (14300) or MSSQL (14306)

Go to Reports- New Query Report and execute this query.

select DISTINCT ac.ACCOUNT_ID as "Login Account ID", au.FIRST_NAME as "Technician Name ( First Name )", count(acs.SESSION_ID) as "Number of Logins", LONGTODATE(max(acs.OPENTIME)) as "Last Login Time", acs.user_host_name as "Ip Address",al.NAME as "Login Name", al.DOMAINNAME as "Domain", aci.EMAILID as "Email", dd.DEPTNAME as "Department", LONGTODATE(au.CREATEDTIME) as "Account Created At", repuser.FIRST_NAME as "Reporting Manager", sd.ISVIPUSER as "VIP User" from aaauser au left join AaaUserContactInfo auci on au.USER_ID=auci.USER_ID left join AaaContactInfo aci on auci.CONTACTINFO_ID = aci.CONTACTINFO_ID inner join sduser sd on au.USER_ID=sd.USERID left join UserDepartment ud on sd.USERID = ud.USERID left join DepartmentDefinition dd on ud.DEPTID=dd.DEPTID left join usersitemapping usm on au.USER_ID=usm.USERID inner join portalusers pu on sd.USERID=pu.USERID inner join portaltechnicians pt on pu.ID = pt.ID inner join aaalogin al on au.USER_ID = al.USER_ID inner join aaaaccount ac on al.LOGIN_ID = ac.LOGIN_ID left join aaaaccsession acs on ac.ACCOUNT_ID = acs.ACCOUNT_ID left join aaauser repuser on repuser.USER_ID = sd.REPORTINGTO where pu.STATUS = 'ACTIVE' and usm.SITEID in ($Site) and (acs.OPENTIME is NULL or acs.OPENTIME > <from_today> ) group by ac.ACCOUNT_ID, au.FIRST_NAME, al.NAME, al.DOMAINNAME, aci.EMAILID, dd.DEPTNAME, au.CREATEDTIME, sd.REPORTINGTO, sd.ISVIPUSER, repuser.FIRST_NAME,acs.user_host_name

order by au.FIRST_NAME

                  New to ADSelfService Plus?

                    • Related Articles

                    • Login Frequency Query Report

                      The below report would help us find the last logged in time of the users in SCP 11.0 SELECT AaaUser.FIRST_NAME "Technician",        MAX(AaaLogin.NAME) "LoginName",        MAX(AaaContactInfo.EMAILID) "Email",        MAX(AaaAccSession.USER_HOST) "IP ...
                    • Query to track technician activity on tickets (MSSQL & PGSQL)

                      Tested in build PGSQL (14300) and MSSQL (14306) Use case: This query will help you find what are all activities that the technicians have done on requests other than the assigned ones SELECT au.first_name "Technician" ,wo.WORKORDERID "Request ...
                    • Query to show technician created time (MSSQL & PGSQL)

                      Tested in build PGSQL (14300) and MSSQL (14306) PGSQL & MSSQL: SELECT AaaUser.FIRST_NAME "Technician Name", aci.emailid "Email ID", LONGTODATE(AaaUser.createdtime) "Technician Created Time", SDUSER.STATUS "Status(Active/Inactive)" FROM AaaUser left ...
                    • Query to get the Login Hours of Technicians (Postgres)

                      Tested in build PGSQL (14300) 1) To generate the total login hours per technician select ai as "Account ID", tn as "Technician Name ( First Name )", lh as "Login hours", LONGTODATE(llt) as "Last Login Time", ln as "Login Name", domain as "Domain", ...
                    • Query to take report of all techinician details with last login time (V10.6) (MSSQL & PGSQL)

                      Tested in builds from PGSQL (14300) or MSSQL (14306) The query is compatiable with version 10.6 and above: Query: Select au.FIRST_NAME "Technicianname" , ar.NAME "Role",al.name "Login Name",aci.emailid "EmailID",SDUSER.STATUS ...