Is there a way to bulk move users from one group to another?

We recently implemented LDAP and there is significant overlap between our users in the confluence internal directory and our active directory. While we're happy to make the 'switch' and lower the priority of the internal directory below the active directory, this will cause issues as our group names do not match exactly.

For example, we have a group in our internal directory called "staff" which contains all our staff members (as opposed to a group called "client", which contains just about everyone else) but in our active directory, this group is called "all-staff".

When we swap the order of the directories, the "staff" group (that we've applied to just about every space) that we set up will be useless as all our staff users will be in the "all-staff" group.

I have two questions, one of which I hope we can do:

  1. Can we bulk move the active directory users in the "all-staff" group to the "staff" group? OR
  2. Can we bulk change the group permissions (or rename?) the space permissions from "staff" to "all-staff"?

Thanks

3 answers

1 accepted

allo,
There is no pretty way to do this via the UI but I believe we could bulk change the permissiosn via the database. The following SQL would change all permission entries for the group 'staff' and make them for 'all-staff'. Please keep in mind, this would be for ALL permissions that were specific to the 'staff' group across the entire instance of Confluence. Furthermore, I have not tested this against antying other then a small local instance. With that in mind, I highly suggest trying this in a test environment first and be sure to create a backup of the DB first.

UPDATE SPACEPERMISSIONS SET PERMGROUPNAME='all-staff' where PERMGROUPNAME='staff';

Cheers,
Andrew

P.S make sure Confluence is off when making these changes.

Thanks! I'll try it out.

Reading this question I found some imporvement requests which informs similiar request that are still under analysis:

https://jira.atlassian.com/browse/CONF-26594

https://jira.atlassian.com/browse/JRA-4138

https://jira.atlassian.com/browse/JRA-3174

JIRA Improvement Request portal....where requests go to die. 

1 vote

Hello,

You could also do it with the Power Scripts for Confluence add-on:

https://marketplace.atlassian.com/apps/1219507/power-scripts-for-confluence?hosting=server&tab=overview

It is a free add-on. Here is the script you need:

string[] users = usersInGroups({"remove group name"});

for(number i = 0; i < size(users); i = i + 1) {
removeUserFromGroup(users[i], "remove group name");
 addUserToGroup(users[i], "add group name");
}

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,551 views 25 14
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you