Hi,
I'm looking for a query I can target to a usercollection. Goal is to find the computers these users logged on to in order to know what computer(s) they own.
Technology Tips and News
Hi,
I'm looking for a query I can target to a usercollection. Goal is to find the computers these users logged on to in order to know what computer(s) they own.
You could create a device collection and use the "Username" property of the SMS_G_Computer_System view to filter on a user ID...
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.UserName = "CONTOSO\\johndoe"
If you're comfortable with SQL, this will work:
select
u.Full_User_Name0, u.Unique_User_Name0, s.Name0 from v_fullcollectionmembership fcm
join v_R_User u on fcm.ResourceID = u.ResourceID
join v_R_System s on s.User_Name0 = u.User_Name0
where
fcm.CollectionID = '<Your Collection ID>'