Query to fetch the machines from a specific OU
I have a request from the client that Create Collection with the Specfic OU machines in it. I have one query it is not working. 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 = "DL.GWORLD.KPMG.COM/London/Clients/GD5"
April 11th, 2011 4:44am

Can somebody help me to get the one working query.
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2011 4:44am

If SCCM is unaware of that OU then that query would return nothing. Other than that the query looks fine. Try the following query instead: 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 SystemOUName like "DL.GWORLD.KPMG.COM/London/Clients/GD5%" Both queries return exactly the same results, as both of them look at child objects, however this query ends up being slightly better since it will also match OUs that are not known to SCCM (and still return the same results the same query would do if SCCM knew about that OU). cogu
April 11th, 2011 4:52am

Why is it not working? Have you tried searching for "SMS_R_System.SystemOUName" here in the forums? You will get tons of example WQL queries then: http://social.technet.microsoft.com/Search/en-US/?query=SMS_R_System.SystemOUName%20&rq=meta:Search.MSForums.GroupID(2a118fc8-6e85-4637-821e-4231d2eef7c9)+site:microsoft.com&rn=All+System+Center+Configuration+Manager+ForumsTorsten Meringer | http://www.mssccmfaq.de
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2011 4:53am

Hi Cogu, This did not work
April 11th, 2011 5:03am

Hi Cogu, This did not work did you try Torsten suggestion.there are lots of quiries with causes what makes the OU informaiton not listed. There is nothing wrong from your query.What does the error do you get when below qeury used.If you dont see any computers with this query ,then probably the OU informaiton from the computers are not discovered.Check if you have enabled AD system group Group and monitor the log file for status. http://technet.microsoft.com/en-us/library/cc181248.aspx 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 ="DL.GWORLD.KPMG.COM/London/Clients/GD5" Right click computer and see if System OU property has any info or not. //Eswar Koneti @ www.eskonr.com
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2011 5:14am

Hi Cogu, This did not work 1- Do you see the computers you are trying to find under All Systems? 2- Do you have AD Group Discovery enabled? 3- When you try to build your query through the GUI do you see the path you are trying to query in the list?
April 11th, 2011 5:31am

Hi, The problem could be that you may have to add the "DistinguishedName" attribute to your AD discovery & run a full System and System group discovery. Once it's done, try to build the query with the "DistinguishedName" attribute value, let me know if your problem is solved or if you need more informations.
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2011 5:48am

Hi Torsten, I searched the queries from the above link provided but i have the same one which is not working. Can you please guide me on this. Regards, Umar
April 11th, 2011 9:24am

What about answering the questions first? For example: do you see the computer in the 'all system' collection? Does the OU show up when bringing up the properties of such a resource?Torsten Meringer | http://www.mssccmfaq.de
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2011 9:38am

Btw, just noticed my 2nd question should have been: 2- Do you have AD System Discovery enabled? cogu
April 11th, 2011 10:13am

Hi Torsten, Yes to all your questions.
Free Windows Admin Tool Kit Click here and download it now
April 12th, 2011 3:15am

Hi Cogu , It is enabled
April 12th, 2011 3:15am

Hi Torsten, Yes to all your questions. So You see the OU informaiton from Resource(computer) properties . Does "Not working "mean,the query is giving any error while creating collection or collection does not display any computers with criteria given? If so,please check if you have specified the correct LDAP path (correct OU) in AD sys grp discovery. //Eswar Koneti @ www.eskonr.com
Free Windows Admin Tool Kit Click here and download it now
April 12th, 2011 3:34am

u786farooq, You didn't answer all the previous questions: 3- When you try to build your query through the GUI do you see the path you are trying to query in the list? Also, please do the following: Pick a computer that is on the AD OU you want to make a query for, find its computer object in the All Systems collection and enter the properties of that computer object. Find the following properties and give us all of their values in the exact way they appear: "Agent Name" "Agent Time" "System OU Names" cogu
April 12th, 2011 3:45am

Hi All, Thanks for all your efforts in helping me to resolve this. there was a small miss from my end as we have multilpe Primary sites and i missed to add the OU information in one of the site. As soon as i added the OU information in Active directory system group the machines started appearing in the collection. Thanks once again.
Free Windows Admin Tool Kit Click here and download it now
April 12th, 2011 4:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics