Collection question

Duchemin, Dominique 2,006 Reputation points
2022-04-29T20:21:44.9+00:00

Hello,

I have a collection define as:

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_NETWORK_ADAPTER_CONFIGURATION on SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.ResourceID = SMS_R_System.ResourceId
where SMS_R_System.OperatingSystemNameandVersion like "%server%"
and (SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSPrimaryServer = "10.1.20.154"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSPrimaryServer = "10.2.112.21"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSPrimaryServer = "10.6.58.224"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSPrimaryServer = "10.12.87.5"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSPrimaryServer = "10.5.20.52"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSSecondaryServer = "10.1.20.154"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSSecondaryServer = "10.2.112.21"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSSecondaryServer = "10.6.58.224"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSSecondaryServer = "10.12.87.5"
or SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSSecondaryServer = "10.5.20.52")

Is there any possibilty to get it under the form:
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_NETWORK_ADAPTER_CONFIGURATION on SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.ResourceID = SMS_R_System.ResourceId
where SMS_R_System.OperatingSystemNameandVersion like "%server%"
(SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSPrimaryServer in ("10.1.20.154", "10.2.112.21", "10.6.58.224", "10.12.87.5", "10.5.20.52")
or
SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.WINSSecondaryServer in ("10.1.20.154", "10.2.112.21", "10.6.58.224", "10.12.87.5", "10.5.20.52"))

Thanks,
Dom

Microsoft Configuration Manager
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AlexZhu-MSFT 6,031 Reputation points Microsoft Vendor
    2022-05-02T01:48:26.29+00:00

    Hi,

    I'm afraid this is not possible. The WMI uses the WQL language which is only a subset of the SQL language, and doesn't include the IN operator. In the above case, we can only use the OR operator.

    Regards
    Alex

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.