Morpheus Posted September 19, 2013 Report post Posted September 19, 2013 I created a user collection from a AD object container. Now i'd like to create a device collection of this AD user collections primary devices? Does someone know how to do that? Quote Share this post Link to post Share on other sites More sharing options...
lord_hydrax Posted September 24, 2013 Report post Posted September 24, 2013 Yep use this query: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_UserMachineRelationship on SMS_UserMachineRelationship.ResourceID = SMS_R_System.ResourceID where SMS_UserMachineRelationship.UniqueUserName like "domain\\username" Make sure you use a double backslash \\ otherwise it won't work. Alternatively, you can search any user under Users in Assets and Compliance and down in the bottom pane under Related Objects there is a option 'Primary Device' you can click to see the primary devices. Quote Share this post Link to post Share on other sites More sharing options...
Morpheus Posted September 25, 2013 Report post Posted September 25, 2013 Yep use this query: 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_UserMachineRelationship on SMS_UserMachineRelationship.ResourceID = SMS_R_System.ResourceID where SMS_UserMachineRelationship.UniqueUserName like "domain\\username" Make sure you use a double backslash \\ otherwise it won't work. Alternatively, you can search any user under Users in Assets and Compliance and down in the bottom pane under Related Objects there is a option 'Primary Device' you can click to see the primary devices. Thanks. Thats the right way! But this will get my all the devices which this user has been loged in. And with this Query i would have to enter all usernames by myself. Because of that i created a USER COLLECTION with the Users which i need. But i can't deploy this application to the USER COLLECTION. Because of that i would like to create a DEVICE COLLECTION of this Users primary devices. Quote Share this post Link to post Share on other sites More sharing options...