Home

 

Add owners and members to a community

As administrator, you can use scripts accessed using the wsadmin command-line tool to add owners and members to existing communities. You can only add individuals to a community; you cannot add a group to a community. There is no limit on the number of members that you can add to a community.


To use administrative commands, use wsadmin. See Start wsadmin for details. Changes to Communities administrative settings do not require a server restart to take effect, and no file checkout is necessary.


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 you are using the following MBean commands, you can determine what went wrong by examining the SystemOut.log file.Restriction: The CommunitiesService.addMembersToCommunity(String communityName, String memberRole, String emailAddresses) command is now deprecated. Use one of the commands listed below instead.

To add new members to a community...

  1. Start wsadmin so that you can access Communities configuration files.

    1. Access the Communities configuration files:

      If you are asked to select a server, you can select any server.

  2. Use the following commands to add additional members or owners to an existing community.


    Commands for adding community members

    Option Description
    CommunitiesService.addMembersToCommunityByEmail(String communityName, String memberRole, String emailAddresses) Adds members to an existing community.

    You use this command in two steps. First, create a comma-separated list of users (using their e-mail addresses) that you want to add to an existing community 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 be sure to specify the name of the community exactly.

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

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

    CommunitiesService.addMembersToCommunityByMemberUuid(String communityName, String memberRole, String UUID of member) Adds members to an existing community. Use this command when you want to add users to a community's membership list, but they don't have an e-mail address.

    You use this command in two steps. First, create a comma-separated list of users (using their UUID, the external LDAP ID) that you want to add to an existing community 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 be sure to specify the name of the community 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)
      


Administer Communities

 

Related tasks

Create and populate communities


+

Search Tips   |   Advanced Search