how do I omit a resource ID from a collection query (Full Version)

All Forums >> [Scripting Technologies] >> General Scripting



Message


pbouvier409 -> how do I omit a resource ID from a collection query (4/11/2008 10:45:49 AM)

Is there any Omit command that I can use to exclude specific machines from a collection in a query statement?





kdsrazor -> RE: how do I omit a resource ID from a collection query (4/11/2008 12:36:43 PM)

What scripting language?  What type of query?

If you're talking about doing a WMI query in a VB script, you can just use a NOT in your query.

Select * from Win32_LogicalDisk where FileSystem = 'NTFS'

vs

Select * from Win32_LogicalDisk where NOT FileSystem = 'NTFS'

Here is another example using greater than and less than from a different script:
Select * FROM Win32_ComputerSystem WHERE UserName <> "domainName\UserName"

Of course these examples aren't for selecting computers, but you get the idea.





jhinkle -> RE: how do I omit a resource ID from a collection query (5/4/2008 11:35:51 PM)

You would want to use a not in statement if you want to exclude the member of a specific collection from a query. It would be something like:

Select name0
from sms_R_System
where name0 not in
(Select name0 from sms_R_System
where SMS_R_System.resourceID = <Collection member table>.resourceid)

I did that from the top of my head, but you get the idea.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.171875