UnauthorizedAccessException - Some users are not updating

Most users are being updated as expected, but a few employees are not being updated and the error message that shows for these employees is…



This is most likely caused because the account you defined in the AD connection, which is used to make all inserts/updates in AD does not have permissions to change the accounts that are giving the error.

I recommend using an account with elevated privileges to test if this is the case. If the account with elevated privileges does work, then you know that it is in fact an issue with account permissions.