PSDscResources icon indicating copy to clipboard operation
PSDscResources copied to clipboard

MSFT_UserResource: ValidateCredentials method fails if user account is locked

Open RandomNoun7 opened this issue 6 years ago • 0 comments

Details of the scenario you tried and the problem that is occurring

When a user of the resource tries to manage a user account that is disabled, the resource fails with an error - "This user can't sign in because this account is currently disabled."

Verbose logs showing the problem

Suggested solution to the issue

Please implement error handling in the ValidateCredentials method that can account for errors calling LogonUser which do not indicate invalid credentials.

The relevant errors to account for are: ERROR_ACCOUNT_RESTRICTION, ERROR_INVALID_LOGON_HOURS, ERROR_INVALID_WORKSTATION, ERROR_ACCOUNT_DISABLED

As documented on the Windows Dev Center Docs.

RandomNoun7 avatar May 10 '19 19:05 RandomNoun7