2009-08-20 1 views
0
내가 쓰기 C#에서

...Active Directory의 컴퓨터 개체에서 managedBy 속성을 어떻게 업데이트합니까? 나는() CommitChanges에 전화를 걸 때

DirectoryEntry computer = GetComputer(); 

computer.Properties["managedBy"].Value = null; 

computer.CommitChanges(); 

그것은,

A constraint violation occurred. (Exception from HRESULT: 0x8007202F) 

뭔가 null로 "하면 ManagedBy"속성을 설정 문제입니다 COM 예외가 발생합니다 하지만 그 밖에 재산을 어떻게 없애 죠?

답변

1

PropertyValueCollection 클래스에는 Clear() 메서드도 있습니다.이 메서드는이 작업을 수행해야합니다.

설정중인 속성에 현재 AD 값이 없기 때문에 오류가 발생할 수 있습니다.

+0

답변, 아니요 투표 ??? – benPearce

0

나는 대답을 찾지 못했지만, Linq TO AD 프로젝트를 사용했으며,이 경우 작동합니다.

관련 문제