{"action":"created","issue":{"url":"https://api.github.com/repos/mcavage/node-ldapjs/issues/342","repository_url":"https://api.github.com/repos/mcavage/node-ldapjs","labels_url":"https://api.github.com/repos/mcavage/node-ldapjs/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/mcavage/node-ldapjs/issues/342/comments","events_url":"https://api.github.com/repos/mcavage/node-ldapjs/issues/342/events","html_url":"https://github.com/mcavage/node-ldapjs/issues/342","id":129812199,"number":342,"title":"New User Not Enabled Upon Creation","user":{"login":"jasoncmcg","id":695352,"avatar_url":"https://avatars.githubusercontent.com/u/695352?v=3","gravatar_id":"","url":"https://api.github.com/users/jasoncmcg","html_url":"https://github.com/jasoncmcg","followers_url":"https://api.github.com/users/jasoncmcg/followers","following_url":"https://api.github.com/users/jasoncmcg/following{/other_user}","gists_url":"https://api.github.com/users/jasoncmcg/gists{/gist_id}","starred_url":"https://api.github.com/users/jasoncmcg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasoncmcg/subscriptions","organizations_url":"https://api.github.com/users/jasoncmcg/orgs","repos_url":"https://api.github.com/users/jasoncmcg/repos","events_url":"https://api.github.com/users/jasoncmcg/events{/privacy}","received_events_url":"https://api.github.com/users/jasoncmcg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-29T16:16:23Z","updated_at":"2016-02-04T19:38:14Z","closed_at":null,"body":"When I create a new user in *Active Directiory*, it is _disabled_ until I **manually** reset the password and enable them (using ADUC).\r\n\r\nI am using the following approach:\r\n```\r\n  client.add ( userDn, entry, function (err, result) { console.log(err, result); }  } );\r\n```\r\n\r\nWith the following entry object:\r\n\r\n```\r\n    var entry = {\r\n\tdisplayName: displayName, \t\r\n\tsAMAccountName: samAccountName, \t\r\n\tname: name,\r\n\tsn: name,\r\n\tgivenName: givenName,\r\n\tmailNickname: samAccountName,\r\n\tuserPrincipalName: userPrincipalName, \r\n\tphysicalDeliveryOfficeName: officeName, \t\r\n\tcompany: company, \t\r\n\tinfo: sourceInfo, \t\r\n\tdepartment: locationCode, \t\r\n\tmail: [email],\r\n\tobjectClass: ['organizationalPerson', 'person', 'top', 'user'],\r\n\tobjectCategory: personCategory\r\n\tdescription: 'auto created on ' + (new Date()).toLocaleString()\r\n  }\r\n```\r\n\r\nIf I attempt to add in the `userPassword` property, the process will return a [UnwillingToPerformError] with a 5003 WILL_NOT_PERFORM code. \r\n\r\nI have tried to use the iconv-lite library to encode in utf16-le and I have tried the node-ssha256 found in the only references that I could dig up.\r\n\r\nAccording to this powershell reference, the account is disabled because I am not able to supply the proper secureString password with the account:\r\n\r\n```\r\n   -AccountPassword SecureString\r\n       A new password value for an account.\r\n       This value is stored as an encrypted string.\r\n       If an empty or $null password is specified a Random password will be set.\r\n       If the password does not meet password policy the account will be disabled\r\n        \r\n       User accounts, by default, are created without a password.\r\n       A valid user account password may also be specified manually.\r\n       User accounts will never be enabled unless a valid password is set\r\n                \r\n       The following example will prompt for a password.\r\n          -AccountPassword (Read-Host -AsSecureString \"AccountPassword\")\r\n```\r\n\r\nAdding a `userAccountControl: 512` to the object to enable the account upon creation also fails. \r\n\r\nCalling a modify from the creation callback also fails. And, this is using a password that is compliant with the enforced policies."},"comment":{"url":"https://api.github.com/repos/mcavage/node-ldapjs/issues/comments/180017554","html_url":"https://github.com/mcavage/node-ldapjs/issues/342#issuecomment-180017554","issue_url":"https://api.github.com/repos/mcavage/node-ldapjs/issues/342","id":180017554,"user":{"login":"jasoncmcg","id":695352,"avatar_url":"https://avatars.githubusercontent.com/u/695352?v=3","gravatar_id":"","url":"https://api.github.com/users/jasoncmcg","html_url":"https://github.com/jasoncmcg","followers_url":"https://api.github.com/users/jasoncmcg/followers","following_url":"https://api.github.com/users/jasoncmcg/following{/other_user}","gists_url":"https://api.github.com/users/jasoncmcg/gists{/gist_id}","starred_url":"https://api.github.com/users/jasoncmcg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasoncmcg/subscriptions","organizations_url":"https://api.github.com/users/jasoncmcg/orgs","repos_url":"https://api.github.com/users/jasoncmcg/repos","events_url":"https://api.github.com/users/jasoncmcg/events{/privacy}","received_events_url":"https://api.github.com/users/jasoncmcg/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T19:38:14Z","updated_at":"2016-02-04T19:38:14Z","body":"nvm, I believe it to be related to the ldaps connection with a cerificate."}}