Active Directory provisioning can be very tricky in some situations. Lately I experienced that point by having the following error message while unsuccessfully trying to insert users in AD :
A device attached to the system is not functioning
As you can see, the error message is too generic to be relevant and I couldn’t find anything interesting in the online Microsoft documentation, so I had no choice but testing every single mapped AD attribute and that’s how I could understand that the problem was the sAMAccountName attribute length, which has to be shorter than 20 characters.
Keep in mind that when you see the above error in an AD provisioning context, it generally means that one of the attributes constraints is not respected.