一、錯誤情況
環境:win7+iis7.0
DirectoryEntry配置IIS7出現如下錯誤
或是
下面代碼在IIS6.0下代碼在IIS6. :
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. 0x80005000)
at System. DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()🠟,約.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配置相容性」。
如下圖:
在Windows Server 2008下,使用角色服務安裝完“IIS 元資料庫和IIS 6配置相容性”,還有可能出現以下錯誤:
[System.Runtime.InteropServices.COMException] {"Access is denied.rn "} System.Runtime.InteropServices.COMException
ErrorCode 0x80070005Access is denied.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfail)p. at System.DirectoryServices.DirectoryEntry. get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)
這是因為使用者 Windows了. 你需要用管理員(Administrator)帳戶執行這個程式. 另一種方式是設定執行此程式的帳戶擁有以下權限: Logon as a Service"/ "Logon as a Batch Job"
以上就是解決DirectoryEntry配置IIS7出現ADSI Error錯誤的方法,還有引申出來的Windows Server 2008出現這種錯誤的解決辦法,希望對大家解決這類問題有所幫助。 )相關文章請關注PHP中文網!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

WebStorm Mac版
好用的JavaScript開發工具

SecLists
SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

Dreamweaver Mac版
視覺化網頁開發工具

Safe Exam Browser
Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。