Deleting Users

Prerequisites

You have imported the required interfaces and gotten the required factories.

More information: User Management Functions for Users .

Context

This procedure describes how to delete a user programmatically from the user store. Use this procedure if you cannot use the existing user administration tools to delete a user and need to customize your tools to create users programmatically.

Procedure

  1. Use the IUser interface to get the user object.
  2. User the deleteUser() method to delete the user.

Example

This example gets the user demo_user and deletes it.

public static void deleteUser(String logonID) {

	try {

		// Get the user.

		IUser user = userFactory.getUserByLogonID(logonID);

		// Delete the user.

		userFactory.deleteUser(user.getUniqueID());

	} catch (NoSuchUserException nsuex) {
		// TODO: Handle NoSuchUserException.
	} catch (NoSuchUserAccountException nsuaex) {
		// TODO: Handle NoSuchUserAccountException.
	} catch (UMException umex) {
		// TODO: Handle UMException.
	} catch (UMRuntimeException umrex) {
		// TODO: Handle UMRuntimeException.
	}
}