Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to query unsynced users using SQL

Hi all

Is there a way to query using SQL all unsynced users? I want to get a list of all users who has been deactivated (on our LDAP)

I'm also looking for a way how to delete those users...

Thanks a lot for any help

Ramy

1 answer

1 accepted

0 votes
Answer accepted

Hi

I think, i was able to create the query. I'm sharing it with you and any improvements are welcome :)

SELECT *
FROM cwd_user u
WHERE u.id NOT IN (
SELECT u.id
FROM cwd_user u
JOIN cwd_membership m ON u.id = child_user_id 
JOIN cwd_group g ON m.parent_id = g.id
JOIN SPACEPERMISSIONS sp ON g.group_name = sp.PERMGROUPNAME
JOIN cwd_directory d on u.directory_id = d.id
WHERE sp.PERMTYPE='USECONFLUENCE'
AND u.active = 'T'
AND d.active = 'T'
GROUP BY u.id, d.directory_name
);

Cheers

Ramy

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

37,727 views 27 124
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you