A new Flexera Community experience is coming on November 25th. Click here for more information.
In versions of FlexNet Manager Suite before 2021 R1.4, Apple devices may show the user that is currently logged on rather than the last logged-on user in the Last logged on field of the Ownership tab (Inventory Device Properties > Ownership tab). If no user was logged onto the Apple device when it was inventoried, you'll see the user listed as "System."
Read more about the Ownership tab.
If you are experiencing this issue, you can follow the instructions below to find the last logged-on user.
SELECT
ho.ComputerID AS ExternalID,
c.computercn,
LEFT(hv.Value, 250) AS LastLoggedOnUser
FROM dbo.HardwareObject AS ho
JOIN dbo.HardwareClass AS hc ON hc.HardwareClassID = ho.HardwareClassID
JOIN dbo.HardwareClass AS sc ON sc.HardwareClassID = hc.SuperClassID
JOIN dbo.HardwareValue AS hv ON hv.HardwareObjectID = ho.HardwareObjectID
JOIN dbo.HardwareProperty AS hp ON hp.HardwarePropertyID = hv.HardwarePropertyID
Join dbo.computer As C ON c.ComputerID = ho.ComputerID
WHERE sc.Class = 'CIM_UnitaryComputerSystem'
AND hp.Property = 'UserName'
AND hv.Value != 'SYSTEM'
and c.ComputerCN = <Name of Device>
This query will return something like the image below:
Important: All users should have a prefix of "Domain" followed by their username. If the user is displaying only the username and no domain, you will not be able to see the last logged-on user. This occurs when the matching script can't match a domain user to a local user. In this case, you must either assign the user on the ownership tab or get the user to log in as a domain account to see the last logged-on user. |
SELECT
ho.ComputerID AS ExternalID,
c.computercn,
LEFT(hv.Value, 250) AS LastLoggedOnUser
FROM dbo.HardwareObject AS ho
JOIN dbo.HardwareClass AS hc ON hc.HardwareClassID = ho.HardwareClassID
JOIN dbo.HardwareClass AS sc ON sc.HardwareClassID = hc.SuperClassID
JOIN dbo.HardwareValue AS hv ON hv.HardwareObjectID = ho.HardwareObjectID
JOIN dbo.HardwareProperty AS hp ON hp.HardwarePropertyID = hv.HardwarePropertyID
Join dbo.computer As C ON c.ComputerID = ho.ComputerID
WHERE sc.Class = 'CIM_UnitaryComputerSystem'
AND hp.Property = 'UserName'
and c.ComputerCN = <Name of Device>
Nov 04, 2022 01:01 PM