How I can find in the GSS database a username that started a particular task?
search cancel

How I can find in the GSS database a username that started a particular task?

book

Article ID: 207954

calendar_today

Updated On:

Products

Ghost Solution Suite

Issue/Introduction

Question:
Where in the GSS database might we find a username that started a particular task?

For example, after we boot into WinPE and the DAgent connects to GSS (Ghost Solution Suite), someone will assign a task to that new computer. 

Environment

GSS 3.3

Resolution

The following query may help to get the required information. You may also review tables used in this query and adjusted as needed.  The following SQL query uses the status_log table.  This table is reset after one day and the data is moved into the status_log_archive.  Therefore, you can use the following for the current day only, or the second query for historical and current information.
 
SQL query for just the current day:
select
comp.computer_name as [computer name],
ev.name as [job name],
u.name as [user name],
sl.schedule_time as [job schedule time],
sl.status as [job statuses]
from status_log sl
join computer comp on comp.computer_id=sl.computer_id
join event_schedule es on es.schedule_id = sl.schedule_id
join event ev on ev.event_id = es.event_id
join securityuser u on u.user_id = sl.user_id
SQL query for the current day and other days:
select
        comp.computer_name as [computer name],
        ev.name as [job name],
        u.name as [user name],
        sl.schedule_time as [job schedule time],
        sl.status as [job statuses]
    from status_log sl
    join computer comp on comp.computer_id=sl.computer_id
    join event_schedule es on es.schedule_id = sl.schedule_id
    join event ev on ev.event_id = es.event_id
    join securityuser u on u.user_id = sl.user_id 
union all
select 
        cp.computer_name as [computer name],
        ha.event_name as [job name],
        us.name as [user name],
        sl.schedule_time as [job schedule time],
        sl.status as [job statuses]
    from history_archive    ha
    join status_log_archive sl ON sl.history_id = ha.history_id
    join computer           cp on cp.computer_id = sl.computer_id
    join securityuser       us on us.user_id = sl.user_id 
order by 4 desc