Re: UnauthorizedAccessException when updating a directory service entry from ASP.NET



Hi Andrew,

I did a simple test on Windows Server 2008 and it works fine. The code is
the same as yours.

Then I tried several hours on my side to reproduce this issue and finally
found a way to reproduce the same exception. The way to repro is to check
"User cannot change password" option for the user account.

1. Click Start-> right click Computer-> click "Manage".

2. Expand "Configuration" node-> Expand "Local Users and Groups".

3. Click "Users" node.

4. Find the user account used in your application and double click it.

5. In the "General" tab, please check if "User cannot change password" has
been checked. If it's checked please uncheck it and run your application
again.

Please try the above steps to check. If it's not the cause please provide
the call stack of this exception and check the event log to see if some
clues can be got from there.

Regards,
Allen Chen
Microsoft Online Support

.