We help IT Professionals succeed at work.

SCCM query help

it-services
it-services asked
on
Medium Priority
5,572 Views
Last Modified: 2013-11-21
Hi

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%""

Regards

Mat




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

Comment
Watch Question

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

Hope that made sense.

Cheers

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT

Commented:
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

Cheers

Author

Commented:
Thanks Matrixnz that has worked
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.