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!