SCCM query help

Posted on 2009-02-12
Last Modified: 2013-11-21

I'm having trouble with an SCCM query not returning the correct information.

I'm trying to do a dynamic collection of computers based on their hostname. My computers are named LIB-<Building>-<number>

Examples: LIB-HSS-01, LIB-BUS-15

What I am trying to do is get a list of all computers in a building. So I've run the SMS query below but I don't get any results. Can someone please point me in the right direction fo where I am going wrong.

The criteria I set up to generate the query was "System Resource.Name uppercase is equal to "%BUS%""



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 UPPER(SMS_R_System.Name) = "%BUS%"

Open in new window

Question by:it-services
    LVL 29

    Accepted Solution

    You need to use "Like" not "=" otherwise the WildCard "%" is seen as a real identifier.

    Hope that made sense.

    LVL 29

    Expert Comment

    Also I assume that BUS isn't inside the name by default but you could be more specific, also wouldn't worry about the upper.  Use something like
    "LIB-BUS-%" this makes it more specific

    LVL 1

    Author Closing Comment

    Thanks Matrixnz that has worked

    Featured Post

    Don't lose your head updating email signatures!

    Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users should you!

    Join & Write a Comment

    Suggested Solutions

    Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
    Know what services you can and cannot, should and should not combine on your server.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now