Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6383847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:42:05+00:00 2026-05-25T02:42:05+00:00

In my program (jldap-based) I trying to enable user in AD by setting userAccountControl

  • 0

In my program (jldap-based) I trying to enable user in AD by setting userAccountControl value to 512.
User created with following attributes:

objectClass=user
cn=username
name=username
userAccountControl=512
userPassword={BASE64}<base64 encoded password>
sAMAccountName=username
distinguishedName=username,CN=Users,DC=company,DC=com

But I get exception:

LDAPException: Unwilling To Perform (53) Unwilling To Perform
LDAPException: Server Message: 0000052D: SvcErr: DSID-031A0FC0, problem 5003 (WILL_NOT_PERFORM), data 0

May be anybody can tell me where I’m making an error? Maybe I forgot some required attribute?

EDIT:

My code (It is trivial and I think that no errors in it):

LDAPConnection connection;
LDAPMessageQueue messageQueue;
...
LDAPAttributeSet attributes = new LDAPAttributeSet();
attributes.add(new LDAPAttribute("objectClass", "user"));
attributes.add(new LDAPAttribute("cn", "username"));
attributes.add(new LDAPAttribute("name", "username"));
attributes.add(new LDAPAttribute("userAccountControl", "512"));
attributes.add(new LDAPAttribute("userPassword", "{BASE64}<base64 encoded password>"));
attributes.add(new LDAPAttribute("sAMAccountName", "username"));
attributes.add(new LDAPAttribute("distinguishedName", "username,CN=Users,DC=company,DC=com"));

LDAPEntry entry = new LDAPEntry("CN=username,CN=Users,DC=company,DC=com", attributes);
connection.add(entry);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:42:05+00:00Added an answer on May 25, 2026 at 2:42 am

    This error can arise when the password is not correctly encoded. Make sure it’s a Base64 encoded UTF-16LE string.

    Example (if you are using Oracle JVM)

    String pass = "password";
    sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();
    String encoded = enc.encode(pass.getBytes("UTF-16LE"));
    

    UPDATE 1:
    Have you tried running your code without the userAccountControl attribute (to rule in or out that it’s actually that attribute that is causing problems)?

    I noticed that your distinguished name attribute looks a bit strange, as well. It should probably look something like CN=username,OU=Users,DC=company,DC=com.

    UPDATE 2: see Adding a user with a password in Active Directory LDAP. WILL_NOT_PERFORM can be returned if you are trying to set password for an entry (which you are, since you’re creating it) over a non-SSL connection. You need to make sure you are connecting to the AD server over SSL (and set up certificates as required).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My program collects the number of bottles collected by four rooms. When the user
This program has the user input name / age pairs and then outputs them,
program reads the following data from a .txt file: f 3.40 f 4.00 m
My program sets its display based on if the program is running for the
The program I am developing gets three times slower when I call the following
my program installs my custom service and register it. Now what I am trying
my program is based on Google's Hello Gallery example: http://developer.android.com/guide/tutorials/views/hello-gallery.html Instead of using images,
I program in Java and have been trying to understand exactly what operator overloading
This program is written in C++. I am trying to use a void function
Program followed by output. Someone please explain to me why 10,000,000 milliseconds from Jan

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.