LDAPのアカウント作成をPHPで作成しようとしています。
ただ、UserAccountControllを512の有効にしようとすると
以下のエラーが出ます。
Warning (2): ldap_add(): Add: Server is unwilling to perform [erro_path.php, line xxx]
ソースコードは以下の通りです。
php
1$ldapConn = ldap_connect('x.x.x.x'); 2 3$info['name'] = "test_test"; 4$info['cn'] = "testo taro"; 5$info['sn'] = "testo"; 6$info['givenName'] = "taro"; 7$info['displayName'] = "testo taro"; 8$info['sAMAccountName'] = $get_account_name; 9$info['company'] = $get_firstname; 10$info['title'] = $get_firstname; 11$info['userPrincipalName'] = "test_taro@test-trial.co.jp"; 12$info['msDS-PhoneticLastName'] = "test"; 13$info['msDS-PhoneticFirstName'] = "taro"; 14$info['mail'] = "test_taro@test-trial.co.jp"; 15$info['objectclass'] = "user"; 16 17// このUserAccountControlがなければ登録できる 18$info['UserAccountControl'] = "512"; 19 20ldap_add($ldapConn, "cn=testo taro,OU=Users,OU=test-trial,DC=tests-upper,DC=com", $info); 21 22 23
環境は以下です。
WindowsServer2012
UserAccountControlが原因だと思うのですが
どうすれば解決できるのか不明です。
目的はPHPでLDAPアカウントを有効の状態で追加したいと思っています。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。