Try below query.

SELECT DISTINCT
v_R_System.Netbios_Name0 as "Computer Name",
v_R_System.User_Name0 as LastLoggedOnUser,
v_GS_OPERATING_SYSTEM.Caption0 as "Operating System",
v_GS_COMPUTER_SYSTEM.Manufacturer0 as "Manufacturer"
FROM
v_R_System
inner join v_GS_OPERATING_SYSTEM on v_GS_OPERATING_SYSTEM.ResourceID = 
v_R_System.ResourceID
inner join v_GS_COMPUTER_SYSTEM on v_GS_COMPUTER_SYSTEM.ResourceID = 
v_R_System.ResourceID
inner join v_FullCollectionMembership on v_FullCollectionMembership.ResourceID 
= v_R_System.ResourceID
inner join v_Site on v_FullCollectionMembership.SiteCode = v_Site.SiteCode
WHERE
v_FullCollectionMembership.CollectionID = 'COL001'
ORDER BY
v_R_System.Netbios_Name0


Regards,

Dhiraj




From: listsadmin@lists.myitforum.com [mailto:listsadmin@lists.myitforum.com] On 
Behalf Of Brian McDonald
Sent: 15 April 2016 08:56
To: ms...@lists.myitforum.com
Subject: [mssms] List of PCs in a Collection - how to get the associated users 
for each device


Is it possible to look-up the last logged on user to a PC in SCCM natively? I 
have a collection of 50 devices and have been asked to get the last logged on 
user for each of these devices. What's the best way to do this?



Thanks,
Brian


________________________________

This email is confidential and intended only for the use of the individual or 
entity named above and may contain information that is privileged. If you are 
not the intended recipient, you are notified that any dissemination, 
distribution or copying of this email is strictly prohibited. If you have 
received this email in error, please notify us immediately by return email or 
telephone and destroy the original message. - This mail is sent via Sony Asia 
Pacific Mail Gateway..


Reply via email to