Deleting Users 
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.
You have imported the required interfaces and gotten the required factories.
More information: User Management Functions for Users.
Use the IUser interface to
get the user object.
User the deleteUser() method
to delete the user.
This example gets the user demo_user and deletes it.
Syntax
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.
}
}