Una delle cause possibili di questo errore è quando, in .NET, si cerca di creare un utente in Active Directory valorizzando l'attributo sAMAccountname con più di 20 caratteri.
System.DirectoryServices.AccountManagement.PrincipalOperationException
HResult=0x80131501
Message=A device attached to the system is not functioning.

Source=System.DirectoryServices.AccountManagement
StackTrace:
at System.DirectoryServices.AccountManagement.ADStoreCtx.Insert(Principal p)
at System.DirectoryServices.AccountManagement.Principal.Save()
at Msys.Ducati.AccountManagement.Data.ADDataService.<>c__DisplayClass11_0.<UserAdd>b__0() in E:\MSYS\TFS\AB\AccountManagement\Msys.Ducati.AccountManagement\Msys.Ducati.AccountManagement\Data\ADDataService.cs:line 240
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
DirectoryServicesCOMException: A device attached to the system is not functioning.
Soluzione: ridurre la lunghezza del valore di sAMAccountname fino ad un massimo di 20 caratteri.