Show TOC

Deleting UsersLocate this document in the navigation structure

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.

Recommendation

We do not recommend that you delete users, but rather lock them and set their validity date so that they are no longer valid. This is to keep the users in the system for the purpose of maintaining an audit trail.

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.

                


                // Delete the user.

                


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