Link to home
Start Free TrialLog in
Avatar of it-services
it-services

asked on

SCCM query help

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

ASKER CERTIFIED SOLUTION
Avatar of matrixnz
matrixnz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of matrixnz
matrixnz

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
Avatar of it-services

ASKER

Thanks Matrixnz that has worked