Hey there! How are you?
My Name is Steffen and I’m quite new to this fantastic n8n community. I try to automate an entire IT onboarding process. Creating the user from scratch or as a copy from an existing user still works. Now I’m stuck with the active directory groups.
Describe the problem/error/question
I want to copy Active Directory Groups to a newly created user with a ldap node
What is the error message (if any)?
argument must be a string (was: object)
Please share your workflow
Share the output returned by the last node
I have an array with a various amount of groups with all the CN information I need. In the meantime I know that it’s not possible to modify the “memberOf” attribute directly but to add the user to all the groups instead. How can I loop through all the items and add the user? Is it possible with the ldap node or any other?
Like I said, it’s an array with values. If I try to fetch a single string the following error occurs:
0000209A: SvcErr: DSID-031A1092, problem 5003 (WILL_NOT_PERFORM), data 0 Code: 0x35
This error means that you have to add the user to the groups and not the groups to the user. So I need something like a loop over a ldap node that add the user in all different groups from the array before.
** EDIT **
If I switch the DNs between user and the first group and rename the “memberOf” attribute to “member” only, I’m able to add the user to the first group. This is the way, but how can I loop?
thank you for your answer and your time. I receive the following error on the last node:
0000202B: RefErr: DSID-0310084B, data 0, 1 access points ref 1: ‘contoso.com’ Code: 0xa [item 0]
But I’ve found a solution with a code-node to loop every single item. I hope this snippet helps other users with a similar problem.