DirectoryServicesCOMException: A device attached to the system is not functioning.

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.

External References

  • 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.
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to DirectoryServicesCOMException: A device attached to the system is not functioning.

  1. Josh says:

    After hours of playing with my code, this solution solved my error. I was setting a samaccountname of more then 20 letters. You have NO idea how much I appreciate finding this site. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s