PSDscResources
PSDscResources copied to clipboard
MSFT_UserResource: ValidateCredentials method fails if user account is locked
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