So a customer of mine wanted a report from configuration manager to list primary devices for their users.
Here is the SQL query I used to create this report.
select vru.Name0 as [User Name], vrs.Name0 as [Computer Name] from v_UsersPrimaryMachines upm left join v_R_User vru on upm.UserResourceID = vru.ResourceID left join v_R_System vrs on upm.MachineID = vrs.ResourceID WHERE vru.Name0 != 'Null' order by vrs.Name0
Would you have an example of how this report comes out?
Thanks for the query. Helped create a primary machine report very quickly.