1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem SCCM Query statement not working

Discussion in 'Software' started by Theprof, Nov 19, 2010.

  1. Theprof

    Theprof Petabyte Poster Forum Leader

    4,570
    68
    196
    I am looking at setting up a collection on SCCM to query the computers in each of my OU's I setup the following 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 where SMS_R_System.SystemOUName = "MYDOMAIN.LAN/WORKSTATIONS/CONTOSO/TEST"

    However when running this statement on the SQL Query analyzer, it gives me an error:

    Msg 208, Level 16, State 1, Line 1
    Invalid object name 'SMS_R_System'.

    Upon doing some research I figured out that SMS_R_System is a discovery query that SCCM uses to discovery AD objects and as such this command is not recognized as a valid query command in the SQL Analyzer.

    Note that when I select my value within the collection, I do not see the CONTOSO/TEST OU all I see is MYDOMAIN.LAN/WORKSTATIONS/CONTOSO. I then manually write out the sub-OU of the CONTOSO.

    Is there something I am missing?
     
    Certifications: A+ | CCA | CCAA | Network+ | MCDST | MCSA | MCP (270, 271, 272, 290, 291) | MCTS (70-662, 70-663) | MCITP:EMA | VCA-DCV/Cloud/WM | VTSP | VCP5-DT | VCP5-DCV
    WIP: VCAP5-DCA/DCD | EMCCA
  2. SimonD

    SimonD Terabyte Poster Moderator

    3,463
    397
    199
    Prof, first of all forgive me, way too many drinks tonight.

    There are two types of query that you can do with SCCM, the first is the SQL query, the second is the SCCM query.

    What you have (rightly btw) identified is an SCCM query, this queries SCCM directly rather than the SQL database.

    How have you configured your discoveries? was this based at the root of the domain or at the Workstation OU level?

    Anyway, for the moment stick with the SCCM query as it's generally easier.
     
    Certifications: CNA | CNE | CCNA | MCP | MCP+I | MCSE NT4 | MCSA 2003 | Security+ | MCSA:S 2003 | MCSE:S 2003 | MCTS:SCCM 2007 | MCTS:Win 7 | MCITP:EDA7 | MCITP:SA | MCITP:EA | MCTS:Hyper-V | VCP 4 | ITIL v3 Foundation | VCP 5 DCV | VCP 5 Cloud | VCP6 NV | VCP6 DCV | VCAP 5.5 DCA
    WIP: VCP6-CMA, VCAP-DCD and Linux + (and possibly VCIX-NV).
  3. Theprof

    Theprof Petabyte Poster Forum Leader

    4,570
    68
    196
    Hi Simon, thanks for getting back to me! I always appreciate it.

    Anyways I have Active Directory System Group Discovery, Security Group Discovery, System Discovery, and Heartbeat Discovery. (which is on by default I believe)

    The query is based at the workstation OU and not the root.
     
    Certifications: A+ | CCA | CCAA | Network+ | MCDST | MCSA | MCP (270, 271, 272, 290, 291) | MCTS (70-662, 70-663) | MCITP:EMA | VCA-DCV/Cloud/WM | VTSP | VCP5-DT | VCP5-DCV
    WIP: VCAP5-DCA/DCD | EMCCA
  4. Theprof

    Theprof Petabyte Poster Forum Leader

    4,570
    68
    196
    I got this resolved Simon, I forgot to added the OU's that I wanted to discover to the AD System Discovery OU, I only had the discovery point to my test OU. You were hinting at the right direction! Thanks again! :biggrin
     
    Certifications: A+ | CCA | CCAA | Network+ | MCDST | MCSA | MCP (270, 271, 272, 290, 291) | MCTS (70-662, 70-663) | MCITP:EMA | VCA-DCV/Cloud/WM | VTSP | VCP5-DT | VCP5-DCV
    WIP: VCAP5-DCA/DCD | EMCCA

Share This Page

Loading...