Remove a user from communities 

Use an administrative command to remove a specified user from the membership of their communities and subcommunities.

Before you begin

To use administrative commands, use the wsadmin client. See Starting the wsadmin client for details. The administrative command for removing a user from communities and subcommunities does not require a server restart to take effect, and no file checkout is necessary.

About this task

You can manage community membership to allow for situations in which employees leave the organization and no longer require access to their communities. The CommunitiesService.removeAllMembershipByDirectoryUuid command removes a specified user from all the communities and subcommunities to which they belong.


To remove a specified user from their community and subcommunity membership...

  1. From the dmgr host:

      cd $DMGR_PROFILE/bin
      ./ -jython

      If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, pick the node where the file is stored.

  2. Use the following command:

      CommunitiesService.removeAllMembershipByDirectoryUuid(String directoryUuid)

        Removes the specified user from any communities and subcommunities to which they belong.

        The command takes a single parameter:


          A string that specifies the directory UUID (external ID) of the user whose membership you want to remove.

        If the user is the last owner of a community or subcommunity, they are not removed, and the community or subcommunity is included in the return value for this call. The command returns a vector of hash maps of all the communities and subcommunities where the user was not removed because they are the last owner.

        To obtain the directory UUID to use as input into this command, use one of the commands below. Both commands return the user's external ID.

        • CommunitiesMemberService.getMemberExtIdByEmail("email")

        • CommunitiesMemberService.getMemberExtIdByLogin("login")

        For example:


Parent topic

Manage membership in Communities

Related concepts
Manage users

September 21, 2011 by Fernando K  


Sep 21, 2011 7:27:12 PM Fernando K   Sample code is wrong, it should be removeAllMembershipByDirectoryUuid 1