Resetting passwords in AD LDS not honoring password history via Java ldap api

I am trying to implement reset password functionality for accounts in Windows 2012 R2 AD
LDS via java ldap api. But it is not honoring password history constraint. When I tried to implement change password it is enforcing password history. I am using the following code to reset password.
@Override
public void updatePassword(String password) throws LdapException {
try {
String quotedPassword = "\"" + password + "\""; 
char unicodePwd[] = quotedPassword.toCharArray(); 
byte pwdArray[] = new byte[unicodePwd.length * 2]; 
for (int i=0; i pwdArray[i*2 + 1] = (byte) (unicodePwd[i] >>> 8); 
pwdArray[i*2 + 0] = (byte) (unicodePwd[i] & 0xff); 
ModificationItem[] mods = new ModificationItem[]{new ModificationItem(DirContext.REPLACE_ATTRIBUTE,new
BasicAttribute("UnicodePwd", pwdArray))};
LdapContext ldapContext = (LdapContext)ldapTemplate.getContextSource().getReadWriteContext();
final byte[] controlData = {48,(byte)132,0,0,0,3,2,1,1};
BasicControl[] controls = new BasicControl[1];
final String LDAP_SERVER_POLICY_HINTS_OID = "1.2.840.113556.1.4.2239";
controls[0] = new BasicControl(LDAP_SERVER_POLICY_HINTS_OID, true, controlData);
ldapContext.setRequestControls(controls);
ldapContext.modifyAttributes(getRelativeDistinguishedName(), mods);
} catch (Exception e) {
throw new LdapException("Failed to update password for:" + this.getDistinguishedName(),
e);
Please let me know if I am doing anything wrong.

Hi,
I suggest you check password policy on the AD LDS server.
If the server is under workgroup mode, then local password policy is applied; if it is domain-joined, domain password policy over-rides local password policy, you may also need to check if there is any PSO configured.
More information for you:
AD DS: Fine-Grained Password Policies
https://technet.microsoft.com/en-us/library/cc770394(v=ws.10).aspx
Step 4: View a Resultant PSO for a User or a Global Security Group
https://technet.microsoft.com/en-us/library/cc770848(v=ws.10).aspx
Best Regards,
Amy
Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

Similar Messages

  • Nfs mount point does not allow file creations via java.io.File

    Folks,
    I have mounted an nfs drive to iFS on a Solaris server:
    mount -F nfs nfs://server:port/ifsfolder /unixfolder
    I can mkdir and touch files no problem. They appear in iFS as I'd expect. However if I write to the nfs mount via a JVM using java.io.File encounter the following problems:
    Only directories are created ? unless I include the user that started the JVM in the oinstall unix group with the oracle user because it's the oracle user that writes to iFS not the user that creating the files!
    I'm trying to create several files in a single directory via java.io.File BUT only the first file is created. I've tried putting waits in the code to see if it a timing issue but this doesn't appear to be. Writing via java.io.File to either a native directory of a native nfs mountpoint works OK. ie. Junit test against native file system works but not against an iFS mount point. Curiously the same unit tests running on PC with a windows driving mapping to iFS work OK !! so why not via a unix NFS mapping ?
    many thanks in advance.
    C

    Hi Diep,
    have done as requested via Oracle TAR #3308936.995. As it happens the problem is resolved. The resolution has been not to create the file via java.io.File.createNewFile(); before adding content via an outputStream. if the File creation is left until the content is added as shown below the problem is resolved.
    Another quick question is link creation via 'ln -fs' and 'ln -f' supported against and nfs mount point to iFS ? (at Operating System level, rather than adding a folder path relationship via the Java API).
    many thanks in advance.
    public void createFile(String p_absolutePath, InputStream p_inputStream) throws Exception
    File file = null;
    file = new File(p_absolutePath);
    // Oracle TAR Number: 3308936.995
    // Uncomment line below to cause failure java.io.IOException: Operation not supported on transport endpoint
    // at java.io.UnixFileSystem.createFileExclusively(Native Method)
    // at java.io.File.createNewFile(File.java:828)
    // at com.unisys.ors.filesystemdata.OracleTARTest.createFile(OracleTARTest.java:43)
    // at com.unisys.ors.filesystemdata.OracleTARTest.main(OracleTARTest.java:79)
    //file.createNewFile();
    FileOutputStream fos = new FileOutputStream(file);
    byte[] buffer = new byte[1024];
    int noOfBytesRead = 0;
    while ((noOfBytesRead = p_inputStream.read(buffer, 0, buffer.length)) != -1)
    fos.write(buffer, 0, noOfBytesRead);
    p_inputStream.close();
    fos.flush();
    fos.close();
    }

  • Note 1099850 - Disable history via screen painter

    The installation of the SAP GUI 7.10 with patch level 8 has been completed.
    Where in the SAP screen painter is the option of disabling the history for edit fields?

    Hello,
    showing the screen elements attributes in screen painter, there will be a checkbox "No Inputhisotry" on the "display" tab.
    The feature requires both the latest SAPGUI 7.10 and also a 7.10 backend.
    You might not have latter, which might be the reason why you are not finding the option in screen painter.
    Best regards
    Rolf-Martin

  • I have updated my iOS and now my hotmail will not verify my password through apple mail app.  I have reset password - tried new password and old password and it still gives me password incorrect.  Hotmail works fine on Mac.  Has anyone had this difficulty

    I have updated my iOS and now my hotmail will not verify my password through apple mail app.  I have reset password - tried new password and old password and it still gives me password incorrect.  Hotmail works fine on Mac.  Has anyone had this difficulty and been able to resolve it?

    Did you try deleting the mail account, then adding it back?   I've read a lot of times that is what needs to happen in order for it to work properly.

  • I forgot My iCloud password, and i can not reset it as the system is not accepting the answer to the security questions and also the mail to my apple ID mail box is blocked, how can i reset my password for my apple ID.

    I forgot My iCloud password, and i can not reset it as the system is not accepting the answer to the security questions and also the mail to my apple ID mail box is blocked, how can i reset my password for my apple ID.

    Hello nmssns,
    Thank you for contacting Apple Support Communities.
    You can start with this article to reset your iCloud password. Depending on your exact circumstances, blocked email, forgot security questions, etc., there are links provided to guide you through those issues.
    About Apple ID security questions
    http://support.apple.com/kb/HT5665
    Regards,
    Jeff D.

  • Why will i cloud refuse to log me in even with the right apple ID and password.  I keep having to reset my password but i always get an answer that I have a valid ID and password but it is not an icloud account

    getting the same answer everytime I try to log into i cloud. I get a message that I have a valid ID and password but it is not an icloud account. I have tried for almost a entire year to go there. i have re-downloaded the icloud contorl panel. before I got this notebook  HP windows 8 it was easier . I do not like Internet explorer so I downlloaded.Google chrome. What must I do to go to icloud? I tried Internet Explorer and  chrome. I buy music on itunes and I am not sure I get all the content I purchase. I have had to reset my password often and my email address to. I once spoke to a live tech a long while ago and he helped me combine all my purchased and downloaded music. Now its impossble to talk to anyone on the phone or even online and i am frustrated.

    You must create the account using an Apple device, a Mac (Lion or greater) or an IOS device (IOS5 or greater). Having done that you will be able to sign in from your Windows machine.
    FYI, iCal is an application that can display calendars from iCloud (and others) it is not a calendar itself, merely a calendar client. In Windows Outlook is the calendar client.

  • HT204053 Seems my iCloud password is not the same as my iTunes.  Where do I go to reset my iCloud password?  I cannot access anything when prompted to put in my iCloud password because I do NOT KNOW it.  Thanks!

    Seems my iCloud password is not the same as my iTunes.  Where do I go to reset my iCloud password?  I cannot access anything when prompted to put in my iCloud password because I do NOT know it.  Thanks!  I've used my iTunes password for everything else Apple does and would like to use the same one for my iCloud.

    Do the following:
    Make sure you are signed into iMessage and FaceTime with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iDevice and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then go to Settings>iCloud, tap Sign Out (or Delete Account if you are not running iOS 8) and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • I am trying to log into my apple account and it is telling me my account is disabled.  How can i get it enabled again?  I have tried resetting my password and that did not work.

    I have tried to log into my apple account so I can download my songs onto my iPhone.  It keeps telling me my apple id is disabled.  I've tried resetting my password but that did not work.  How can I fix this?

    After resetting your password you might then need to log out of your account on your device by phone on your id in Settings > Store (Settings > iTunes & App Stores if it's on iOS 6) and then log back in so as to 'refresh' the account on it
    If that doesn't fix it then you might need to contact iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • HT5622 I have a new desktop and re-installed my identity from my airtime back up and on the log in page my picture comes up with my usual password hint, but it is not accepting my password and I do not have the option to reset using my apple id - that par

    I have a new desktop and re-installed my identity from my airtime back up and on the log in page my picture comes up with my usual password hint, but it is not accepting my password and I do not have the option to reset using my apple id - that particular function is in grey and cannot be clicked on

    Depending on what kind of computer you have, you're gonna need to put that backup in the appropriate folder or itunes is not gonna be able to see it for you to use.

  • I have another apple ID but I forgot the password and apple does not send the link to reset it to my email. What do I do to have it back?

    I have another apple ID but I forgot the password and apple does not send the link to reset it to my email. What do I do to have it back? It is really important.

    If you know the answers to your security question for the ID you can use that method to reset the password rather than email (by going to https://iforgot.apple.com/password/verify/appleid).
    If you don't, you'll have to contact iTunes Store support for assistance: http://www.apple.com/emea/support/itunes/contact.html.  They frequently deal with Apple ID issues.

  • How do i delete an old iCloud account from phone when I forget my password and I'm not able to reset it because my security questions do not match?! Help!! Currently not able to update any apps or icloud info

    How do i delete an old iCloud account from phone when I forget my password and I'm not able to reset it because my security questions do not match?! Help!! Currently not able to update any apps or icloud info...

    If your device is signed into an old ID of yours that is an earlier version of the ID you want to sign in with, do the following:
    If you are using iMessage and FaceTime, make sure you are signed into these services with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iDevice and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then save any photo stream photos that you wish to keep to your camera roll (unless you are using iCloud Photo Library).  When finished go to Settings>iCloud, tap Sign Out (or Delete Account if you are not running iOS 8) and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • I forgot my iCloud password, and i can not reset it with email authentication, when i do it, i don't receive any mail from Apple

    I forgot my iCloud password, and i can not reset it with email authentication, when i do it, i don't receive any mail from Apple

    If you don't know your password, don't know your security questions and don't have a rescue address or don't receive a reset email, you should contact AppleCare who will initially try to assist you with a reset email or if unsuccessful will pass you to the security team to reset your security questions for you.
    If you are in a region that doesn't have international telephone support try contacting Apple through iTunes Store Support.

  • Hello. How can I reset my iCloud because i forgot the password to my iCloud and I'm not using the email address i used in that account. What should I do?

    Hello. How can I reset my iCloud because i forgot the password to my iCloud and I'm not using the email address i used in that account. What should I do?

    Try this: https://iforgot.apple.com/password/verify/appleid
    Hopefully you have already set up your security questions.

  • I am trying to reset my apple id unmation onder icloud account infor the original pc that I signed in with...my phone is connected to the pc and I have made the change in email address and password but it will not register on my phone.

    I am trying to reset my apple id under icloud account information on the original pc that I set the account up.  I have changed email addresses now and would like to change to new address.  I have gone through the steps on changing apple id and password and have my phone hooked up to pc but it will not change over to the new address and password thus I can not order any apps or use icloud.  Help!

    Go to Settings, and then turn iMessage and FaceTime on if they are off.  If they are on, then turn them both off, restart the phone, then turn them back on.
    Go back to Settings > iCloud.  Whether the current or old email address is displayed there, try your current password.

  • How to Reset Password of User while not connected to Domain using Local Admin Account

    How to Reset Password of User while not connected to the Domain using Local Admin Account
    (I have the use of a local admin account), and I want to help a user reset their password who has logged in the PC and had their credentials cached, but forgot this password. 
    In Local Admin Account :
    When I go to Control Panel, users, users, manager user ; I cannot see any users in this window except the local admin account, and, so I cannot reset a user password this way.
    When I go to lusrmgr.msc, then users ; the local admin account will display only. 
    If I go to command prompt and type "net user", this will not display any users who have logged in to the computer, and so I cannot use "net user" to reset a password.
    I don't want to use any disks, 3rd party programs, or create a VPN connection to the domain.  I just want to help a user who calls in and forgets their password.

    Hello Keith,
    I know this is an old thread but I'm trying to better understand how I could change the domain password while not on the network. What I'm getting from your post is that you:
    1. Create a local user account (not a domain user)
    2. Login with that local user account
    3. Connect to the VPN while logged in as a local user
    4. Log out of the local account and login with the domain credentials
    Now, my question is based on the assumption that the password created on the local account is the same password that one will use to login to the domain account? Also, is the local user account the same as the domain account?
    Thanking you in advance!

Maybe you are looking for