문제

I try to enable windows account with this code but i ve exception in ObjectSecurity (Null reference) in this line ActiveDirectorySecurity userSecurity = user.ObjectSecurity;

도움이 되었습니까?

해결책

I would suspect that your error would be on the 5th line in the code

user.Properties["userAccountControl"].Value = val & ~0x2; //this will error

and if you were to debug it you would probably see the following error

Error Pointers and fixed size buffers may only be used in an unsafe context

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top