Script to create a user causes the following error: MX Error: 27 (0000001B)


THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • EFT Server version 6.0 and later

SYMPTOM

When running scripts to create a user, I get the following error:

MX Error: 27 (0000001B)

RESOLUTION

“MX Error: 27 (0000001B)” means “Already exists.” This error occurs when using a Create method (e.g., CreateUser) when the COM API tries to create an entity whose name duplicates the name of an existing entity.

To avoid this error

Design the script to check the presence of the named entity before attempting to create a new one (e.g., GetUsers).

The CreateUser[Ex] method will fail if a simple password is provided and enforce complex passwords is enabled in EFT. For example, the following will fail if "enforce complex passwords" is enabled in EFT:

oSite.CreateUser "tuser1", "testpassword", 0 "New User"

For the method to work, you must do one of the following:

  • Disable enforcement of complex passwords.

  • Provide a complex password. For example:

oSite.CreateUser "test", "$1$Bn3YdWKv$.BS3Qb2UQTV4SmV1JNN.w/", 0, "New User"

  • Call the CreateComplexPassword method and use the resulting string in the CreateUser[Ex] method. For example (in pseudo code):

strUserPass = oUserSettings.CreateComplexPassword()

oSite.CreateUser "test", strUserPass, 0, "New User"