+

Search Tips   |   Advanced Search

Add owners and members to a community

Use scripts accessed using wsadmin-line tool to add owners and members to existing communities. We can only add individuals to a community; we cannot add a group to a community. There is no limit on the number of members that we can add to a community.

To use administrative commands, use wsadmin.sh. The administrative commands for adding owners and members to a community do not require a server restart to take effect, and no file checkout is necessary.

We can also use the following commands to add owners and members to subcommunities.

The config-admin Jython scripts that get and set properties use the implicit AdminConfig object available in IBM WebSphere Application Server Admin (wsadmin) to interact with the Communities server.

If an error occurs when we are using the following MBean commands, we can determine what went wrong by examining SystemOut.log.

  1. Start the Communities Jython script interpreter

      cd app_server_root/profiles/Dmgr01/bin
      ./wsadmin.sh -lang jython
      execfile("communitiesAdmin.py")

  2. Add additional members or owners to an existing community or subcommunity.

    CommunitiesService.addMembersToCommunityByEmail(String communityName, Integer memberRole, List emailAddresses)

    Adds members to an existing community or subcommunity.

    When using this command to add owners or members to a subcommunity, the users that we are adding must belong to the parent community in order for them to be added to the subcommunity.

    We cannot exceed the maximum number of members limit specified in the explicitMembershipEntityLimit property of communities-config.xml. See Communities configuration properties.

    Use this command in two steps. First, create a comma-separated list of users (using their email addresses) to add to an existing community or subcommunity and assign this list to a variable. This variable is then used as input into the addMembersToCommunity command.

    Note that communityName is a string and must be enclosed in quotation marks ("). This parameter is case-sensitive, so specify the name of the community or subcommunity exactly.

    memberRole. Valid settings are 0 (member) or 1 (owner). Do not enclose this setting in quotation marks.

    For example:

    wsadmin>threemembers=["alex_jones@myco.com", "mary_smith@myco.com", "paul_henderson@myco.com"]
    wsadmin>CommunitiesService.addMembersToCommunityByEmail("Ski Club Community",0,threemembers)

    When using this command, if the community or subcommunity name that you provide as input to the command is not unique, an error similar to the following displays:

    WASX7015E: Exception running command: 
     "CommunitiesService.addMembersToCommunityByEmail
     ("My community",0,threemembers)"; exception information:
     javax.management.RuntimeMBeanException
     java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: 
     CLFRM0091E: Multiple communities found with name: My community 
    When we see an error like the previous one, instead of entering the name of the community or subcommunity in the command, we must enter the UUID instead.
    For example:

      wsadmin>CommunitiesService.addMembersToCommunityByEmail("5742c4c8-0010-4e6e-abdb-65015e8a22e1", 0,threemembers)

    CommunitiesService.addMembersToCommunityByMemberUuid(String communityName, Integer memberRole, List UUID of member)

    Adds members to an existing community or subcommunity. Use this command to add users to a community's membership list, but they don't have an email address. The users that we are adding must belong to the parent community in order for them to be added to the subcommunity.

    The member's UUID is the external LDAP identifier for a specific user. Use one of the following commands to return the user's external ID for use in the previous command:

    • CommunitiesMemberService.getMemberExtIdByEmail("email")
    • CommunitiesMemberService.getMemberExtIdByLogin("login")

    We cannot exceed the maximum number of members limit specified in the explicitMembershipEntityLimit property of the community-config.xml file. See Communities configuration properties.

    Use this command in two steps. First, create a comma-separated list of users (using their UUID, the external LDAP ID) to add to an existing community or subcommunity and assign this list to a variable. This variable is then used as input into the addMembersToCommunity command.

    Note that communityName is a string and must be enclosed in quotation marks ("). This parameter is case-sensitive, so specify the name of the community or subcommunity exactly.

    memberRole: Valid settings are 0 (member) or 1 (owner). Do not enclose this setting in quotation marks.

    For example:

    wsadmin>onemember=["84b4897d-b4f8-4d95-9621-50bcaa2fd3ca"]
    wsadmin>CommunitiesService.addMembersToCommunityByMemberUuid("Ski Club Community",0,onemember)
    The onemember parameter is the extid(user).

    When using this command, if you get an error telling you the community or subcommunity name is not unique, instead of entering the name of the community or subcommunity in the command input, enter the UUID instead.


Parent topic:
Manage membership in Communities


Related:

Create and populate communities

Remove members from communities

Add an alternate owner to Communities

Related reference:

Communities configuration properties