How can you capture the "last logged in user" User ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2013 03:13 PM
Hello community!
We want to capture the login User ID of the last person to log into a discovered CI even if it does not match to a corresponding record in the Users table (sys_user).
It appears that Discovery will discover the Username (login ID, User ID, etc.) of the person who last logged into the discovered CI and then populate the "Assigned to" field with the "Name" of the record that matches the corresponding "User ID" in the Users table. If a matching record is not found, the field is blank. We want to capture the discovered login name even it is not in the User table.
Does anyone know have any ideas?
Thanks in advance,
Jeff
- Labels:
-
Discovery
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2013 01:34 PM
In your windows OS Information probe (at the bottom is the logic). I would guess you can set an 'else' type statement afterward that sets userName if userID is null...
Sounds simple enough though...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2013 01:29 PM
Thanks for pointing me in the right direction, Doug. I found the logic in the "Windows - OS Information" sensor. I think it may be easier just to create a new field on the CI form called u_lastuserid and add a line after the line that populates the assigned_to field something like this:
current.assigned_to = userID;
current.u_lastuserid = userID;
}
What do you think?
Best regards,
Jeff Welton
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2013 12:25 PM
I was trying to get this feature to populate. I am not sure where to add these fields.. Any help would be appreciated.
Ray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2013 06:04 AM
When I used "current.u_lastuserid = userID" it returned the sys_id of the user (duh!). So I changed it to "current.u_lastuserid = userName" which worked like a charm! The "userName" variable is defined as "var userName = result.Win32_ComputerSystem.UserName" on line 26.
Thanks again for pointing me in the right direction.
Jeff Welton