Tag Archives: ADSI

Annoying error using System.DirectoryServices and IIS App Pools

If you get the following error when manipulating IIS with System.DirectoryServices

System.Runtime.InteropServices.COMException was unhandled
Message=Unknown error (0×80005000)
Source=System.DirectoryServices
ErrorCode=-2147463168
StackTrace:
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)

Don’t forget to install the following role features -> IIS 6 Management Compatability -> IIS 6 Metabase Compatability.

I completely forgot about it and wasted a good hour on it.