Close Menu
    Facebook X (Twitter) Instagram
    Tuesday, May 20
    X (Twitter) LinkedIn
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»CM2012»SCCM Configmgr 2012 Collection for computers with Primary User (UDA) is NULL

    SCCM Configmgr 2012 Collection for computers with Primary User (UDA) is NULL

    Eswar KonetiBy Eswar KonetiMarch 18, 12:00 pm2 Mins Read CM2012 12,395 Views
    Share
    Facebook Twitter LinkedIn Reddit

    If you are using User Device Affinity--associating a user with one or more specified devices  for application deployment to make sure the application install on all devices that are associated with that user,it is necessary to identify the computers which do not have primary User Defined.More about User Define Affinity http://technet.microsoft.com/en-us/library/gg699365.aspx.

    Create collection using below WQL query for list of computers with Primary Device is NULL.(Make sure you limit the collection to computers with Client installed and Active) else you will get all computers who do not have sccm client installed .

    WQL query uses wmi class (SMS_UserMachineRelationship) which store the information only about UDA relationship. Usermachinerelationship will not have any entries for computers do not have UDA relationship.

    so I use subselected query using not in function.Get list of computers for which UDA relationship is not null and compare them with v_r_system active clients.

    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 where SMS_R_System.ResourceId not in (select resourceid from SMS_UserMachineRelationship where UniqueUserName is not null)

    Updated: There was a question on myitform recently ,asking for Users (collection or SQL Report) without Device affinity set.

    For User collection :

    Select * From SMS_R_User where UniqueUserName not in (Select UniqueUserName from SMS_UserMachineRelationship)

    For SQL Report:

    select
    vru.ResourceID,
    vru.Full_User_Name0 as [Full Name]
    from v_R_User vru
    where vru.ResourceID not in (select vru.ResourceID
    from v_UsersPrimaryMachines upm
    left join v_R_User vru on upm.UserResourceID = vru.ResourceID
    where vru.Name0 IS NOT NULL
    )

    Hope it helps.

    Collection Collection User Device Affinity configmgr create collection for Primary Device is NULL primary Device Primary Device is NULL SCCM SMS_UserMachineRelationship UDA UniqueUserName users without device affinity
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    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

    Investigating Co-Management Issues with Windows Endpoints in SCCM/Intune

    October 26, 10:45 pm

    4 Comments

    1. Vasile JICHIN on August 17, 2017 6:21 PM

      Hello, this is some interesting technical stuff. However, it is not granular enough. I say this because if you need a Pilot Group to deploy some software on machines, it would be easily to get the Primary Device for each user inside a specific AD User Group.

      Is this possible to achieve via WQL Query ?
      Does the infrastructure need to be configured in a specific flavor?

      Thanks,
      Vasile

      Reply
    2. Gareth on November 11, 2014 4:42 PM

      Hi,

      Is it possible to restrict UDA to certain machine types i.e. only set a primary device if the device name begins with a certain prefix?

      Thank you.

      Reply
      • Eswar Koneti on November 13, 2014 2:56 PM

        You can create new client agent settings with the required UDA options and apply this to collection .This collection will have all device names that begins with certain prefix .

        Reply
    3. sanso on September 24, 2014 3:41 PM

      Hi,

      thank you a lot for this piece of info. I'll add my WQL query if you have different Full Names from your Login-Names. It's much easier to read the Machine User Affinity this way.

      Select Rel.UniqueUserName, Usr.UniqueUserName, Usr.FullUserName, Rel.ResourceName, Sys.Name from SMS_UserMachineRelationship AS Rel, SMS_R_SYSTEM AS Sys, SMS_R_User as Usr where Sys.ResourceID = Rel.ResourceID AND Rel.UniqueUserName = Usr.UniqueUserName AND Rel.IsActive is not null

      Thanks again.
      sanso

      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-2024 Eswar Koneti, All rights reserved.

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