Configure Groups With Rake Tasks

Use rake tasks to create, modify, and delete groups; to add users to groups; and to import SAML and LDAP groups.

Rake tasks must be run from the Shares shell, as described in the following steps:
  1. Go to the shares folder:
    > cd C:\Shares\www
  2. Test that your rake tasks are working correctly.
    > bundle exec rake -T

Create Group

> bundle exec rake data:group:create -- --group_name group_name

For example:

> bundle exec rake data:group:create -- --group_name projectgroup1

Delete Group

> bundle exec rake data:group:delete -- --group_name group_name

For example:

> bundle exec rake data:group:delete -- --group_name projectgroup1

Add User to a Group

> bundle exec rake data:group:user:add -- --username username --group_name group_name

For example:

> bundle exec rake data:group:user:add -- --username johndoe --group_name projectgroup1

Add LDAP User to a Group

> bundle exec rake data:group:authorizable:user:add -- --username ldap_username --group_name group_name
For example:
> bundle exec rake data:group:authorizable:user:add -- --username johnldap --group_name projectgroup1

Remove User from a Group

> bundle exec rake data:group:user:remove -- --username username --group_name group_name

For example:

> bundle exec rake data:group:user:remove -- --username johndoe --group_name projectgroup1

Export a List of Groups

> bundle exec rake data:group:export -- --path \path\to\file

For example:

> bundle exec rake data:user:export -- --path C:\temp\groupexport.txt

Import Groups from a Text File

> bundle exec rake data:group:import -- --path \path\to\file

If the group already exists in Shares, the rake task does not add the group.

For example:

> bundle exec rake data:group:import -- --path C:\temp\projectgroups.txt

Where the projectgroups.txt file contains the following :

projectgroup1
projectgroup2
projectgroup3
projectgroup4
projectgroup5
projectgroup6

Create SAML Group

> bundle exec rake data:group:saml:create -- --group_name group_name

For example:

> bundle exec rake data:group:saml:create -- --group_name samlgroup1

Fetch Group Details from LDAP

> bundle exec rake data:group:ldap:fetch -- --group_name group_name

For example:

> bundle exec rake data:group:ldap:fetch -- --group_name samlgroup1

Delete LDAP Group

> bundle exec rake data:group:ldap:delete -- --group_name group_name

For example:

> bundle exec rake data:group:ldap:delete -- --group_name samlgroup1