Create a collection or query to check for UDA

Author Message
iglatz

  • Total Posts : 662
  • Scores: 25
  • Reward points : 20150
  • Joined: 9/21/2001
  • Location: Bern - Switzerland
  • Status: offline
Create a collection or query to check for UDA Wednesday, May 30, 2012 9:55 AM (permalink)
0
Hi folks,
 
does anybody know how I can create a simple query to ask whether a machine has a user assigned or not? I checked the report that exists but this SQL query cannot be used for a WQL query. I got stuck trying to figure out building a query to list all machines that don't have a user assigned. I couldn't find an object class nor an attribute class. 
The reason is to have a collection with all machines without UDA to allow a different client settings policy. Any ideas? Thanks.
 
Ingrid
 
#1
    skissinger

    • Total Posts : 4810
    • Scores: 458
    • Reward points : 106230
    • Joined: 9/13/2001
    • Location: Sherry Kissinger
    • Status: offline
    Re:Create a collection or query to check for UDA Wednesday, May 30, 2012 7:46 PM (permalink)
    0
    In the console, monitoring, Queries, make a new query, and switch to show query language (it's not there in the pull down / pick lists)
    and just this to get you started:
     
    select * from sms_usermachinerelationship
     
    I'm guessing you'll want something like...
    where sms_usermachinerelationship.uniqueusername is null
     
    Test of course.  I didn't actually make a collection query...
    http://msdn.microsoft.com.../library/hh949107.aspx
    take a look at that for attribute names. 
     
    Edit: or... just thought of this (since I didn't actually look at a cm12 console, nor am I looking now); perhaps boxes that don't have a UDA relationship simply don't have an entry in sms_usermachinerelationship at all; so maybe it'll need to be a subselect; those resourceids not in (select resourceid from sms_usermachinerelationship where uniqueusername is not null) ???  Again... just sorta dreaming this up.  Not actually doing anything in a console.
    <message edited by skissinger on Wednesday, May 30, 2012 8:00 PM>
    mofmaster@myitforum.com
    My Blog
    Microsoft MVP - ConfigMgr
     
    #2
      iglatz

      • Total Posts : 662
      • Scores: 25
      • Reward points : 20150
      • Joined: 9/21/2001
      • Location: Bern - Switzerland
      • Status: offline
      Re:Create a collection or query to check for UDA Thursday, May 31, 2012 2:06 AM (permalink)
      0
      Hi Sherry,
       
      it sounded pretty good an easy in first place but you were right with the second guess. Machines without an UDA relationship don't even show up in this view sms_usermachinerelationship. And machines where you remove the actual relationship still show RelationActive=1 in the view.
      I think I'll have to dig around that but at least you gave me an idea where to look at and how to start. Maybe a subselect will give me the desired result.
       
      Ingrid
       
      #3
        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 2 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2013 ASPPlayground.NET Forum Version 3.9