Awesome thanks Ryan!!

From: [email protected] [mailto:[email protected]] On 
Behalf Of Ryan
Sent: Friday, August 23, 2013 12:16 PM
To: [email protected]
Subject: Re: [mssms] Creating a membership rule query for a device collection

Wildcards are %.  If you use a wildcard, you need to use "like" instead of "=". 
 Here is the query for all devices that start with L:

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

On Fri, Aug 23, 2013 at 11:10 AM, Kevin Johnston 
<[email protected]<mailto:[email protected]>> wrote:
In CM12 I created Laptop, workstation and server collections. I originally had 
the membership setup as direct (during testing) and noticed that no new 
machines are in these collections.

We mark all out laptops with the prefix of L and our workstations with W

Is there a way to make a query that says anything that starts with L put in the 
laptop collection and anything that starts with W put in the workstation 
collection?

I am not sure about wildcards...

But this is what I have:

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 inner join SMS_G_System_COMPUTER_SYSTEM on 
SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId where 
SMS_G_System_COMPUTER_SYSTEM.Name = "L$"

Thanks,

Kevin Johnston







Reply via email to