From the ministry of silly error messages …
When creating a user through Active Directory you receive the error “
A first chance exception of type 'System.DirectoryServices.DirectoryServicesCOMException' occurred in System.DirectoryServices.dll: A device attached to the system is not functioning.“.
Chances are the sAMAccountName property was set to a string of 20 characters or more.
- Microsoft documents the size restriction here–one would just wish for a more helpful message.
- Everything one could want to do in Active Directory with .NET is shown in this article.