Close Menu
    Facebook X (Twitter) Instagram
    Sunday, October 12
    X (Twitter) LinkedIn Reddit RSS
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»Collections»SCCM collection to use wildcard in String matching

    SCCM collection to use wildcard in String matching

    Eswar KonetiBy Eswar KonetiJune 05, 5:33 pm2 Mins Read Collections 28,159 Views
    Share
    Facebook Twitter LinkedIn Reddit

    Creating collection to get computers that starts and end with particular string is used mostly using % .If this percentile used at the end of the variable name, you get all computer names that starts from particular string and if you use this in the beginning, gets all computers that ends with particular string.

    Examples : To get all computer names that starts with ESKONR, use ESKONR% , to get all computer name that ends with ESKONR ,use %ESKONR.

    But what if  need all computer name that has letters like ESK in the middle of the computer name. Let says i have computers with 15 digits and they have ES placed in 10-11 . Example : INHYD1202ES0003

    We can use underscore as wildcard for one character space and use them along with Like statement and apply to fields.

    Collection :

    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.Name like "__________ES___" and SMS_R_System.ResourceDomainORWorkgroup = "ESKONR"

    We have used 9 underscores in our query before E and 4 Underscores after S to tell that first 9 digits can be any thing and last 4 digits can be anything .

    Underscores (_) as wildcard can be used at any location in the query but one can replace one character only.

    Hope it helps!

    Collection Config mgr 2012 configuration Manager SCCM SCCM 2012 sccm collection sccm collection for specific words in collection wild card in string matching wildcard in sccm collection
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    SCCM SQL Report – Compare Installed Apps on TWO Different Computers

    July 13, 10:35 am

    Optimize Your Intune Workflow with a Powerful Browser Extension

    March 22, 10:39 am

    Migrate Microsoft 365 Updates from SCCM/MECM to Intune for Co-Managed Devices

    February 11, 9:50 pm

    9 Comments

    1. Pingback: Wildcard character in a SCCM task sequence like clause - Boot Panic

    2. Steve on October 20, 2016 5:43 AM

      What if I need a collection that contain the users that have an underscore in it's name?

      Reply
      • Eswar Koneti on October 20, 2016 10:50 PM

        Hi Steve,
        you should try with something %_% ? it depends on the requirement and user naming how it is

        Reply
    3. Brian on May 19, 2016 1:15 AM

      Thanks Eswar for a great post. Very easy steps for a query.

      Reply
      • Eswar Koneti on May 19, 2016 12:35 PM

        Welcome Brain, Glad to help.

        Reply
    4. ryan on April 21, 2016 4:10 PM

      Eswar, I need to get all SGKFE machines....should be SGKFE%, right ?

      Reply
      • Eswar Koneti on April 21, 2016 4:14 PM

        Hi ryan,
        yes, thats true. Give a try.

        Reply
    5. Pavan on February 23, 2016 8:03 PM

      Hi Eswar,

      I am looking to create a dynamic collection that list members of other collections which has the name with 'ABC%'

      Could you help me with a WQL query to create a collection with the query rule that gives all computers of the collections for which the collection name starts with 'ABC%'.

      Thanks in advance.

      Reply
      • Eswar Koneti on February 25, 2016 10:21 PM

        you mean to say ,get list of all PC names from other collections that starts with ABC% ? if am not wrong,ABC% is collection name or PC name to pull the names from ? can you be more specific about the requirement ?

        Reply

    Leave a ReplyCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2025 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.