none
Runbook + Get Collection + Add System into Collection as a Member RRS feed

  • Question

  • Hi,

    My Requirement is to build Service request for Software Requisition.

    I am accepting Software name from Service request and then add/deploy that software to Users system.

    I am not getting below things 

    Get Collection (First I would like to check whether a particular Collection name exist or not. Because we don't have activity to get collection )  --- Need Help

    if Exist then Add user's system into that collection

    if not exist then Create Collection of system.

    Then "Add Member into Collection" here i am unable to add system as there is no parameter seems where we can give system name ----  Need Help

    all these activity i would like to perform in runbook of software installation

    below is my runbooks details

    Monday, May 13, 2019 12:06 PM

Answers

  • I would if you havent done already is install the SCCM console on the Runbook servers

    Use the PowerShell module to leverage what you dont see in the integration pack by using the Run .NET script activity to use a script to check if an SCCM Device collection exists

    For the rules the "Add Collection Rule" step does allow you to use a direct rule to add a single computer to the collection


    Website: www.walshamsolutions.com Technical Blog: https://www.walshamsolutions.com/technical-blog Personal Blog: https://www.walshamsolutions.com/personal-blog Twitter: Dwalshampro

    Tuesday, May 14, 2019 8:37 AM
  • Hi stefan & Dwalsham, thanks for your help.

    Hi Dwalsham, yes it allows me to use direct rule to add single computer, but i was not sure where to specify computer. 

    Hi Stefan, what "Get Col memb 1" will do for me ?

    In Add Collection Rule -- > Rule Name  --> CollectionName - ClientName  does it mean by collection name and  -- system name which we would like to add it manually. can we give directly system name instead of "Get Col memb 1". as i have "Get computer object" activity to get system of logged in users. can i put that value into "ClientName"  ?

    does this way/format apply same for remove member from collection ? for this shall i use "delete collection rule" or "update collection membership" activity

    also is there any way to check only "Get Collection" instead of "Get Collection Member" i just wanted to check if particular collection exist or not. 

    Tuesday, May 14, 2019 3:56 PM

All replies

  • I would if you havent done already is install the SCCM console on the Runbook servers

    Use the PowerShell module to leverage what you dont see in the integration pack by using the Run .NET script activity to use a script to check if an SCCM Device collection exists

    For the rules the "Add Collection Rule" step does allow you to use a direct rule to add a single computer to the collection


    Website: www.walshamsolutions.com Technical Blog: https://www.walshamsolutions.com/technical-blog Personal Blog: https://www.walshamsolutions.com/personal-blog Twitter: Dwalshampro

    Tuesday, May 14, 2019 8:37 AM
  • Hi,

    you can use Activity "Add Collection Rule". Use Direct Memebership with the Name or ID from the System to Add. Use also a distinct Name for the rule, for example "CollectionName - ClientName":

    Regards,

    Stefan


    More and news about System Center at stillcool.de and sc-orchestartor.eu .

    Tuesday, May 14, 2019 12:10 PM
    Answerer
  • Hi stefan & Dwalsham, thanks for your help.

    Hi Dwalsham, yes it allows me to use direct rule to add single computer, but i was not sure where to specify computer. 

    Hi Stefan, what "Get Col memb 1" will do for me ?

    In Add Collection Rule -- > Rule Name  --> CollectionName - ClientName  does it mean by collection name and  -- system name which we would like to add it manually. can we give directly system name instead of "Get Col memb 1". as i have "Get computer object" activity to get system of logged in users. can i put that value into "ClientName"  ?

    does this way/format apply same for remove member from collection ? for this shall i use "delete collection rule" or "update collection membership" activity

    also is there any way to check only "Get Collection" instead of "Get Collection Member" i just wanted to check if particular collection exist or not. 

    Tuesday, May 14, 2019 3:56 PM
  • Hi,

    sorry; according to your Screenshot I thought you wanted to add the members from another collection.

    Yes, of course, you can use there other Activities to get the Collection members. If you get names instead of ID remember to select  names in "Rule Definition Type Value".

    To Remove a system from collection you can use "Delete Collection Rule". Therefore I recommended to use "CollectionName - SystemName" as distinct Name of the Rule.

    For "Update Collection Membership"  you need just the Name or ID of the collection.

    To check if collection exists you can use PowerShell (see Dujons post above). I would not use "Get Collection Members" because you must flatten it to get not a result per member if the collection exists. And when you flatten the result is also falttened. On first look I would use "Update Collection Membership"if I must use the SCCM IP.

    Regards,

    Stefan


    More and news about System Center at stillcool.de and sc-orchestartor.eu .

    Tuesday, May 14, 2019 6:14 PM
    Answerer
  • I am still not able to add system into collection below is the error and configuration details 

    "Failed to add rule 'Rule name' to collection 'Collection Name'". 'Package Name' is not a valid Resource Name

    Monday, June 24, 2019 10:50 AM
  • Hi,

    "Rule Definition" must contain a Ressource Name (hostname) not the Name of the Collection. It seems that in "Rule Definition" there is the same Published Data subscribed as in the other fields ...  


    More and news about System Center at stillcool.de and sc-orchestartor.eu .

    Monday, June 24, 2019 12:42 PM
    Answerer
  • Hi,

    how are the things going?

    Di you manage to create the collection rules?

    Regards,

    Stefan


    More and news about System Center at stillcool.de and sc-orchestartor.eu .

    Friday, August 2, 2019 7:53 PM
    Answerer