Close Menu
    Facebook X (Twitter) Instagram
    Saturday, October 11
    X (Twitter) LinkedIn Reddit RSS
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»CM2012»SCCM Configmgr 2012 How to Create Collection to get list of computers from Users OU using UDA

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

    Eswar KonetiBy Eswar KonetiOctober 30, 3:28 pm2 Mins Read CM2012 4,675 Views
    Share
    Facebook Twitter LinkedIn Reddit

    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 http://technet.microsoft.com/en-us/library/gg699365.aspx

    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 http://eskonr.com/2014/03/sccm-configmgr-2012-collection-for-computers-with-primary-user-uda-is-null/

    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/GIM—Contains list of users and we are retrieving the computers which are associated with UDA.

    Hope it helps!

    CM12 Collection Configmgr 2012 OU based SCCM SMS_UserMachineRelationship UDA WQL Query
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    SCCM SQL Report – Compare Installed Apps on TWO Different Computers

    July 13, 10:35 am

    Optimize Your Intune Workflow with a Powerful Browser Extension

    March 22, 10:39 am

    Migrate Microsoft 365 Updates from SCCM/MECM to Intune for Co-Managed Devices

    February 11, 9:50 pm

    5 Comments

    1. Amr on August 5, 2018 4:49 PM

      Amazing Eskor , but can we change User OU Name to User Security Group ?

      Reply
      • Eswar Koneti on September 2, 2018 12:38 AM

        Hi Amr,
        Yes ,you can but i haven't tried it though. Try to create one and test it . I will probably check it as well.

        Thanks,
        Eswar

        Reply
        • Raj on April 5, 2024 6:23 PM

          Have you created a query for specific ad group of users snd their respective devices in sccm ?

          Reply
          • Eswar Koneti on July 16, 2024 5:04 PM

            Hi,
            as long as the AD groups are being discovered through the AD security group discovery, you should be able to query them using SQL.

            Thanks,
            Eswar

            Reply
    2. Mark Mijnders on May 23, 2016 7:23 PM

      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?

      Reply

    Leave a ReplyCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2025 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.