Adding endpoint list to an AD group

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding endpoint list to an AD group

L2 Linker

Hi,

 

I am currently building a new PlayBook and in one part of that PlayBook, I am trying to add computers, in an XSoar List, to a specific AD group.

 

- I Created a List that contains 2 endpoints separated with a comma ","

- My Playbook is using the Active Directory Query v2:  ad-add-to-group

- Field "computer-name" is filled with the query referencing my XSoar List:   ${lists.MyListName}

 

The problem I am facing is that it is not working with multiple values in my list.  If only 1 computer name is in the list, I have no problem adding that computer to the specified AD group in my PlayBook.  As soon as there is 2 or more value in my list, the task failed.  All value in the list is comma "," separated

 

Here's the full error seen in the War Room:

 

Reason
Could not get full DN for computer with name 'COMPUTER1,COMPUTER2' Last connection result: {"result": 0, "description": "success", "dn": "", "message": "", "referrals": null, "type": "searchResDone"} Last error from LDAP server: None

 

Thanks for your help.

1 accepted solution

Accepted Solutions

L2 Linker

Hey Martin!

I think the part that is creating an issue is the way the list is returning the values.   Basically the list can store a chunk of data in almost any format.  You can comma separate it or use newlines or whatever you want.  You may have to parse the output though.  Our commands can usually iterate over lists but it's going to expect something more like a json or python style list being handed to it.  Use the Split transformer to break up the output to the command before it processes it.  Here's an example:

Screen Shot 2021-06-14 at 10.32.16 AM.png

Created the list as a comma separated value

If I try to print it out now you get basically a single string with all of the values.  You can tell because our Print statement processed it in one command instead of iterating through each of them.

Screen Shot 2021-06-14 at 10.44.37 AM.png

If you create a small playbook, add in the command you want to run and use a transformer like this:

Screen Shot 2021-06-14 at 10.46.03 AM.png

 Then your output will break up into an actual list and process each item individually.

Screen Shot 2021-06-14 at 10.47.13 AM.png

 

 I hope that helps!

Doug Couch  |  XSOAR Customer Success Engineer - Manager
Palo Alto Networks  |  3000 Tannery Way  |  Santa Clara, CA 95054  

View solution in original post

2 REPLIES 2

L2 Linker

Hey Martin!

I think the part that is creating an issue is the way the list is returning the values.   Basically the list can store a chunk of data in almost any format.  You can comma separate it or use newlines or whatever you want.  You may have to parse the output though.  Our commands can usually iterate over lists but it's going to expect something more like a json or python style list being handed to it.  Use the Split transformer to break up the output to the command before it processes it.  Here's an example:

Screen Shot 2021-06-14 at 10.32.16 AM.png

Created the list as a comma separated value

If I try to print it out now you get basically a single string with all of the values.  You can tell because our Print statement processed it in one command instead of iterating through each of them.

Screen Shot 2021-06-14 at 10.44.37 AM.png

If you create a small playbook, add in the command you want to run and use a transformer like this:

Screen Shot 2021-06-14 at 10.46.03 AM.png

 Then your output will break up into an actual list and process each item individually.

Screen Shot 2021-06-14 at 10.47.13 AM.png

 

 I hope that helps!

Doug Couch  |  XSOAR Customer Success Engineer - Manager
Palo Alto Networks  |  3000 Tannery Way  |  Santa Clara, CA 95054  

Hi @DougCouch,

 

Thanks for your help here.  I fixed my problem a couple of weeks ago using the exact same method using a transformer "Split" and using a comma as a delimiter.

 

Thanks for having taken the time to help me out.

 

Have a great day !

 

 

SS.png

  • 1 accepted solution
  • 3239 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!