AddUserToGroups
Add user to Active Directory groups.
Task version: 2.1.0
Required Frends version: 5.5+
Required .NET version: 6.0
Compatible Agents: Crossplatform
Source code: https://github.com/FrendsPlatform/Frends.LDAP
Task Parameters
UserDistinguishedName : String
User's distinguished name (DN)
Default: -
Example: CN=Tes Tuser,ou=users,dc=wimpi,dc=net
GroupDistinguishedNames : String[]
Group distinguished name(s) (DN) to add the user to. Can specify one or multiple groups.
Default: -
Example: new[] { "cn=admin,ou=roles,dc=wimpi,dc=net", "cn=developers,ou=roles,dc=wimpi,dc=net" }
UserExistsAction : UserExistsAction
Handle user exists exception.
Possible values:
Throw: Throw an error.Skip: Do nothing and add LDAP error message to the task's result.
Default: Throw
Example: UserExistsAction.Throw
Host : String
LDAP server host.
This must resolve to a Domain Controller (FQDN) in the same domain
as the target group being modified.
Default: -
Example: dc1.emea.company.com
Port : Int32
Port. Value 0 = use LDAP/LDAPS default port which is 389 or 636 depending on (SecureSocketLayer) and (TLS).
Default: 0
Example: 389
SecureSocketLayer : Boolean
Perform secure operation.
Default: -
Example: true
TLS : Boolean
Connection is protected by TLS.
Default: -
Example: true
User : String
User.
Default: -
Example: Foo
🗝Password : String
Password.
Default: -
Example: Bar123
Task Result
Success : Boolean
Update completed.
Example: true
Error : String
LDAP Error message. Only populated when operation fails.
Example: Entry Already Exists
Details : String
Operation details. Contains information about added and skipped groups when applicable.
Example: Added to 2 group(s): cn=admin,ou=roles,dc=wimpi,dc=net, cn=managers,ou=roles,dc=wimpi,dc=net. Skipped 1 group(s): cn=developers,ou=roles,dc=wimpi,dc=net: User already exists in the group
UserDistinguishedName : String
User DN.
Example: CN=Tes Tuser,ou=users,dc=wimpi,dc=net
GroupDistinguishedName : String[]
Group DN(s).
Example: new[] { "cn=admin,ou=roles,dc=wimpi,dc=net" }
Task Changelog
Changelog for Task Frends.LDAP.AddUserToGroups.
[2.1.0] - 2026-02-03
Changed
Improved documentation for Host parameter usage
[2.0.0] - 2026-01-29
Changed
[Breaking] Input: Changed GroupDistinguishedName (string) to GroupDistinguishedNames (string[]) to support adding users to multiple groups in a single operation.
Result: Added Details property for operation details. Error now only contains error messages for failures.
[1.2.0] - 2025-11-20
Fixed
Fixed LDAP exception when adding duplicate users with skip option enabled.
[1.1.0] - 2025-08-13
Fixed
Fixed KeyNotFoundException when checking empty groups for existing users.
[1.0.1] - 2024-03-01
Fixed
Fixed issue with UserExistsAction parameter when AD returned another error message by adding method to actually check if the user is in the group.
[1.0.0] - 2022-10-07
Added
Initial implementation
Last updated
Was this helpful?

