SCCM Configmgr 2012 How to Create Collection to get list of computers from Users OU using UDA

I had a requirement to deploy patches (part of patch testing) to Department (group of user around 200+) who resides in one OU in Active Directory .The computers used by them are different due to their work nature and they keep moving with different computers (with different apps). I need to get list of computers used by these 200+ users from specific Organizational unit in Active Directory.

With CM12,feature called User Device Affinity --associating a user with one or more specified devices and it eliminates the need to know the names of a user’s devices .More info about UDA ,refer

How to do I use this feature (UDA) to get computers that are associated with users from specific OU ?

Long ago ,I posted Collection query to get list of computers with primary user (UDA) is NULL means

I use instance called SMS_UserMachineRelationship to get the User machine relationship.

Create a device collection ,limit to whatever collection you want and then add query rule ,paste the below query and click ok.

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   JOIN SMS_UserMachineRelationship ON SMS_R_System.ResourceID=SMS_UserMachineRelationship.MachineResourceID   JOIN SMS_R_User ON SMS_UserMachineRelationship.UniqueUserName = SMS_R_User.UniqueUserName
WHERE   SMS_UserMachineRelationship.RelationActive=1 AND   SMS_R_User.UserOUName = "ESKONR.COM/BLG/WF/GIM"

Change the bold letters to the required OU.

ESKONR.COM/BLG/WF/GIMContains list of users and we are retrieving the computers which are associated with UDA.

Hope it helps!

3 Responses to "SCCM Configmgr 2012 How to Create Collection to get list of computers from Users OU using UDA"

  1. Sorry for this late comment, just found this query today.

    How can I add a column that shows the Full Name of the user (User Resource.Full User Name)? The query shows the system names for the users in the specified OU, but now I can't match the users with the systems when looking at the query result?


Leave a Reply