"A device attached to the system is not functioning" error is thrown while creating Exchange Mailbox

Problem: While creating Exchange Mailbox in HC panel, an error is thrown with the description "A device attached to the system is not functioning".

Reason: This error is returned by the system itself as Microsoft Limits the SAM Account Name of an Active Directory User object to be less than or equal to 20 characters. See Microsoft document for reference: https://docs.microsoft.com/en-us/windows/win32/adschema/a-samaccountname

Solution: To avoid this error, do not provide a mailbox with SAM name having a character length greater than 20.