Active Directory의 사용자 항목에 속성/속성을 추가하려고합니다. 다음 코드를 사용하여 속성 값을 업데이트하는 데 문제가 없습니다.Active Directory 사용자 속성 추가
00000057: LdapErr: DSID-0C090B8A, comment: Error in attribute conversion operation, data 0, v1db1
string propertyName = "test";
string propertyValue = "testValue";
user.Properties[propertyName].Add(propertyValue);
user.CommitChanges();
나는이 :
The specified directory service attribute or value does not exist.
ExtendedErrorMessage는 다음 말한다 : 나는 새로운 상품을 추가하고 CommitChanges()
를 호출 할 때
string LDAPString = "LDAP://DC=oc,DC=edu";
DirectoryEntry ou = new DirectoryEntry(LDAPString, "fakeUsername", "password");
DirectorySearcher searcher = new DirectorySearcher(ou);
searcher.Filter = "sAMAccountName=" + username;
SearchResult result = searcher.FindOne();
DirectoryEntry user = new DirectoryEntry(result.Path, "fakeUsername", "password");
user.Properties[propertyName].Value = propertyValue;
user.CommitChanges();
user.Dispose();
그러나 그것은 오류가 발생합니다 나는 단순한 것을 놓치고 있다고 느끼지만 나는 그것을 알아낼 수 없다.
새 속성이 Active Directory에 정의 되었습니까? AD 스키마를 확장 했습니까 ?? 광고에서 임의의 새 속성을 설정할 수는 없습니다 ...... –