Use administrative commands to remove specified users from
the membership of their communities and subcommunities.
Before you begin
To use administrative commands, you must use the wsadmin client.
See Starting the wsadmin
client for details. The administrative commands for removing
members from communities and subcommunities do not require a server
restart to take effect and no file checkout is necessary.
About this task
When employees leave your organization or no longer require
access to communities for some other reason, you can remove them from
the membership of communities and subcommunities. You can remove specified
community members based on their email address or name.Procedure
To remove a specified user from the membership of a community
or subcommunity, complete the following steps.
- Start the wsadmin client from the following
directory of the system on which you installed the Deployment Manager:
app_server_root\profiles\dm_profile_root\bin
where app_server_root is the WebSphere® Application Server
installation directory and dm_profile_root is the
Deployment Manager profile directory, typically dmgr01.You must
start the client from this directory or subsequent commands that you
enter will not execute correctly.
- Start the Communities Jython script interpreter
using the following command:
execfile("communitiesAdmin.py")
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,
you must pick the node where the file is stored.
- Use one of the following commands:
- CommunitiesService.removeAllMembershipByDirectoryUuid(String
directoryUuid)
Removes the specified user from any communities and subcommunities to which they belong.
The command takes the following parameters:
- directoryUuid
- 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 following
commands. Both commands return the user's external ID.
- CommunitiesMemberService.getMemberExtIdByEmail("email")
- CommunitiesMemberService.getMemberExtIdByLogin("login")
For
example:
CommunitiesService.removeAllMembershipByMemberUuid("91b3897d-b4f8-4d05-3621-50bcaa22d300")
- CommunitiesService.removeMembersFromCommunityByEmail(String communityName,
List emailAddresses)
Removes members from an existing community or subcommunity. Members are identified in a list by
their email addresses.
You can remove both owners and members, but you cannot remove the last active owner. You can
remove members from a subcommunity, but you cannot remove owners from a subcommunity.
If an email address in the list does not match any member email address in the community, then
the command fails and none of the members in the list are removed from the community.
You use this command in two steps. First, create a comma-separated list of users (by using their
email addresses) who you want to remove from an existing community or subcommunity, and assign this
list to a variable.
For example:
wsadmin>threemembers=["alex_jones@example.com", "mary_smith@example.com", "paul_henderson@example.com"]
Then
use this variable as input into the
removeMembersFromCommunity command.
For
example:
wsadmin>CommunitiesService.removeMembersFromCommunityByEmail("Ski Club Community",threemembers)
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 or subcommunity exactly.
- CommunitiesService.removeMembersFromCommunityByMemberUuid(String communityName,
List UUID of member)
Removes members from an existing community or subcommunity. Members are identified in a list by
their external ID. Use this command when you want to remove users from a community's membership
list, but they do not have an email address.
You can remove both owners and members, but you cannot remove the last active owner. You can
remove members from a subcommunity, but you cannot remove owners from a subcommunity.
If a UUID in the list does not match any member UUID in the community, then the command fails and
none of the members in the list are removed from the community.
To obtain the directory UUID to use as input for this command, use one of the following commands.
Both commands return the user's external ID.
- CommunitiesMemberService.getMemberExtIdByEmail("email")
- CommunitiesMemberService.getMemberExtIdByLogin("login")
You use this command in two steps. First, create a comma-separated list of users (using their
UUID, the external LDAP ID) who you want to remove from an existing community or sub community. Then
assign this list to a variable.
For example:
wsadmin>onemember=["84b4897d-b4f8-4d95-9621-50bcaa2fd3ca"]
Then use this
variable as input in to the removeMembersFromCommunityByMemberUuid command.
For example:
wsadmin>CommunitiesService.removeMembersFromCommunityByMemberUuid("Ski Club Community", onemember);
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 or subcommunity exactly.