For simple machine filters, you usually specify the criteria for a single type of object. For example, you could create a filter that searches for computers with Microsoft Excel and an 80486 processor:
MICROSOFT|SOFTWARE|1.0:Software Name is 'Microsoft Excel'
AND
MICROSOFT|PROCESSOR|1.0:Processor Name is '486'
You can also build complex machine filters that search for multiple types of objects. For example, you could create a filter that searches for the type of computer specified in the preceding filter and another type such as computers with an 80386 processor and more than 20 MB free on drive C:
MICROSOFT|SOFTWARE|1.0:Software Name is 'Microsoft Excel'
AND
MICROSOFT|PROCESSOR|1.0:Processor Name is '486'
OR
MICROSOFT|PROCESSOR|1.0:Processor Name is '386'
AND
MICROSOFT|DISK|1.0:Disk Index is 'C'
AND
MICROSOFT|DISK|1.0:Free Storage (MByte) is greater than '20'
This filter searches for two distinct types of objects. Each object type is distinguished from its adjacent object type by the OR operator.
You can also search for a type of object that has multiple occurrences of a single group. A single occurrence of a group in an object's inventory is called an instance. Some groups (such as Disk and Software) can have multiple instances on a single computer. For example, a computer can have multiple instances of the group Software—one for each package installed (such as a Microsoft Excel version 4.0 package, Microsoft Word version 2.0 package, and so on).
For example, the following filter finds all computers that have the Microsoft Excel package, the Microsoft Word package, and an 80486 processor:
MICROSOFT|SOFTWARE|1.0:Software Name is like '%Excel%'
AND
MICROSOFT|SOFTWARE|1.0:Software Name is like '%Word%'
AND
MICROSOFT|PROCESSOR|1.0:Processor Name is like '%486%"
When you want to search for an object that has any or all of a set of multiple instances, you can use the OR operator—but you must group the subclause containing the instances. For example, the following filter finds all computers with an 80486 processor and either the Microsoft Excel or Microsoft Word package:
(
MICROSOFT|SOFTWARE|1.0:Software Name is like '%Excel%'
OR
MICROSOFT|SOFTWARE|1.0:Software Name is like '%Word%'
)
AND
MICROSOFT|PROCESSOR|1.0:Processor Name is like '%486%"
If you do not group multiple instances together, SMS interprets the OR clauses as separate objects. For example, the following filter finds all computers with the Microsoft Excel package, and all computers that have both an 80486 processor and the Microsoft Word package:
MICROSOFT|SOFTWARE|1.0:Software Name is like '%Excel%'
OR
MICROSOFT|SOFTWARE|1.0:Software Name is like '%Word%'
AND
MICROSOFT|PROCESSOR|1.0:Processor Name is like '%486%"
Note that some groups logically or physically can have only a single instance (such as identification). If you specify multiple instances of these groups for an object, the filter will return a false result for that portion of the query. For example, the following filter would return a false result because the Identification group is a single instance group (an object cannot have more than one Identification group):
MICROSOFT|IDENTIFICATION|1.0:SMSID is 'RUS00001'
AND
MICROSOFT|IDENTIFICATION|1.0:SMSID is 'UKR00002'