exclude a user from people directory

Hi all,

Does anyone know how to exclude a user from the "people directory". 

It would be useful to not display "admin" for example.

Thanks,

Alicia

3 answers

1 accepted

0 vote
Davin Studer Community Champion Sep 11, 2014

There is no easy way to do it. There aren't any options you can set to exclude them ... lame as it is. I had to hijack the search page to do this.

What I did for this is I created some JavaScript that I included in the "At the end of BODY" section in the custom HTML. This script will run on each page at this point since it is included on every page. So, I do a check in the script first thing to see if I am on the people directory page. If so, then I hide the default search form and create my own that has the inputs I want with a submit button. When the submit button is clicked it generates the search string that will give me the people I want to look up, but I also exclude in the search string the people I don't want to show. The I populate the default search field that is hidden with the generated string and programatically click the default, now hidden, button.

I also change the "People" link in the top header bar to have a default search that removes the unwanted account(s). Some thing like this ...

http://{server}/dopeopledirectorysearch.action?queryString=%5Ba+TO+zzzz%5D+NOT+admin&search=Search&showOnlyPersonal=false&startIndex=0

What this is doing is returning every one from A to ZZZZ (which should be everyone) except anything with admin in it. The reason for this is when you click the people link it will show you everyone at first ... including the people you don't want to see. So, to avoid these people showing I just start the people search process with a default search string that removes them.

Thanks for your answer! I have instead opted to rename my admin account to something more relevant to users (ie. Service Desk). This also makes sure it is not the first user in the people directory so it is less conspicuous. Thank you for your help though.

Hi Alicia, 

If you are using LDAP or AD, you can exclude users or groups of users with an LDAP query string filter

Its a little tricky, but this doc describes it pretty well. https://confluence.atlassian.com/display/CROWD/Restricting+LDAP+Scope+for+User+and+Group+Search

These "Crowd" fields are found in Confluence when configuring your LDAP User Directory (Admin > Users & Security > User Directories). Among other, you have to specify the LDAP schema and then your user object filter (or group object filter) like described in above link. This is especially useful if you have ex-employee or service accounts and you want to remove them from counting against your Confluence license (and also will fall out of the People Directory). 

Hope that helps maybe down the line as you go.

Justin

Davin Studer Community Champion Dec 18, 2014

This does remove them from the directory,but also removes them from the system. I think the question was about having someone who can log in, but does not show in the people directory ... such as a service account.

I do not consider admin a "service account". A "service account" is an account often found in ADs/LDAPs to perform a service without a human. An "admin" account I think always has a user associated with it. However, point taken. An admin with that name shown in the People DIrectory does not make sense, and yes, filters removes from system. So all depends on what they are after in the People Directory.

You could write a custom plugin to extract certain users information from the Lucene search index. This would remove them out of the directory.

Perhaps add the users to a particular group, then remove group members.This is similar to a "Do Not Index" plugin I wrote recently which removes pages based on their label

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published 10 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

91 views 2 4
Read article

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