create a collection

Glenn Maxwell 13,141 Reputation points
2021-11-05T05:00:09.023+00:00

Hi All

i have a collection and i have a servers list in a text file and i want to import this text file i.e i want to add the servers in the text file to the collection. Experts guide me on this.

My text file is in below format
server01.contoso.com
server02.contoso.com
server03.contoso.com

Microsoft Security | Intune | Configuration Manager | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. AllenLiu-MSFT 49,436 Reputation points Microsoft External Staff
    2021-11-05T07:48:50.163+00:00

    Hi, @Glenn Maxwell
    Thank you for posting in Microsoft Q&A forum.

    We can use PowerShell command Add-CMDeviceCollectionDirectMembershipRule easily bulk add multiple devices to SCCM device collection.
    Here is the details you may refer:
    https://www.prajwaldesai.com/add-multiple-devices-to-sccm-collection-using-powershell/
    (Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)


    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.



2 additional answers

Sort by: Most helpful
  1. Rahul Jindal 11,596 Reputation points
    2021-11-05T07:24:18.093+00:00

    I normally use excel to put the list of devices in this format using concatenate - "device name",

    Then drop the list using query in collection like select * from SMS_r_system where name in ("device name", "device name2")

    0 comments No comments

  2. AllenLiu-MSFT 49,436 Reputation points Microsoft External Staff
    2021-11-17T07:34:30.707+00:00

    Hi, @Glenn Maxwell
    We didn't get the response from you for some days, may we know the current status of this question?

    0 comments No comments

Your answer

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