Automate user invitation in Vaultwarden for AD users, seeking API assistance


I use Vaultwarden and Active Directory in a larger organization.

I want to write a PS1 script that connects to Vaultwarden and checks whether a user from AD is also created in Vaultwarden. If the user is not created in Vaultwarden, the script should send an invitation via email to an organization. The script will be automated, so I will have less manual work finding the email of a user in AD and inviting them to Vaultwarden. This will reduce the time spent on invitations, allowing more time for other workloads. :blush:

I already tried to find the API using the Bitwarden CLI, but that did not work. I also attempted to locate it using the developer console (F12), but that also failed. Is there any way to invite users to an organization using a function? Alternatively, how can I find the required API?

Thank you for any assistance. <3

Maybe you should take a look at: About Directory Connector | Bitwarden Help Center

1 Like

Hello again :slight_smile:

I use “Directory Connecter” and it works fine so far. ( Sync with AD and thx for your previos help!)

How can I make it so that the user is also added to a collection directly after the sync, without having to do this manually?
For this I noticed in the json file that there is an item called “collections” and the question is what should I enter there?

Many Thanks in Advance

Create groups and link those groups to collection, and link those users to the correct groups.

1 Like

Good Morning,

so I really searched for how to create groups etc., but I cant find how i can do these things. Could you elaborate on how to do it?

Thanks again :slight_smile:

See Sync with Active Directory or LDAP | Bitwarden Help Center it explains how to configure the tool including how to sync the groups.

1 Like

In Vaultwarden you also have to set ORG_GROUPS_ENABLED=true to enable the groups feature.

1 Like