首页 > php教程 > PHP开发 > 正文

DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000)

高洛峰
发布: 2017-01-06 16:17:11
原创
1731人浏览过

一、错误情况

环境:win7+iis7.0

DirectoryEntry配置IIS7出现如下错误

DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000)

或者是

下面一段代码在IIS6.0下运转正常,但IIS7.0下运转会出错:

System.DirectoryServices.DirectoryEntry iisServer;
iisServer = new System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1");
System.DirectoryServices.DirectoryEntry rootFolder = iisServer.Children.Find("Root","IIsWebVirtualDir");//此处抛出异常
登录后复制

   

异常内容如下:

[System.Runtime.InteropServices.COMException] {"Unknown error (0x80005000)"} 
System.Runtime.InteropServices.COMException
Unknown error (0x80005000)
   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)

二、错误分析

这段异常代码表明 IIS://localhost/W3SVC/1 的ADSI provider不存在或者无法访问。

打开IIS管理器你可以看到服务器的localhost(即默认站点)是存在的并正在运行,且主站点ID确实是1。这说明问题是出现在 IIS://localhost的ADSI provider。

三、错误原因

win7使用的是iis7,而IIS 7默认并没有安装ADSI provider。

四、解决方法

要解决这个问题就得安装“IIS 元数据库和IIS 6配置兼容性”。

“控制面板”->“程序和功能”->面板左侧“打开或关闭windows功能”->“Internet信息服务”->“Web管理工具”->“IIS 6管理兼容性”->“IIS 元数据库和IIS 6配置兼容性”。

如下图所示:

DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000)

DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000)

 五、Windows Server 2008出现这种错误怎么办?

在Windows Server 2008下,使用角色服务安装完“IIS 元数据库和IIS 6配置兼容性”,还有可能出现如下错误: 

[System.Runtime.InteropServices.COMException] {"Access is denied.\r\n"} System.Runtime.InteropServices.COMException
ErrorCode 0x80070005
Access is denied.

   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)

这是因为 Windows Server 2008被UAC(User Account Control,用户账户控制)锁定了.  你需要用管理员(Administrator)账户执行这个程序. 另一种方式是设置运行此程序的账户拥有如下权限: Logon as a Service"/ "Logon as a Batch Job"

 以上就是解决DirectoryEntry配置IIS7出现ADSI Error错误的方法,还有引申出来的Windows Server 2008出现这种错误的解决办法,希望对大家解决这类问题有所帮助。

更多DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000)相关文章请关注PHP中文网!

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号