连接到远程 2008 服务器上的 IIS 元数据库
我编写了一些代码来检查 iis 元数据库,以查看安装了哪些站点及其虚拟目录的保存位置。该代码在服务器本地运行时运行良好。
我正在尝试扩展它,以便它可以远程工作。我正在努力让它进行身份验证。我目前正在使用 LogonUser
api,但这在登录时总是返回 false
- 我知道我拥有的凭据很好
- 我和服务器之间没有防火墙
- 如果我运行应用程序时没有从命令行进行
LogonUser
API 调用和用户运行时,我收到错误:COMException (0x80005000)
如有任何想法,我们将不胜感激。
I have written a bit of code that inspects the iis metabase to see what sites are installed and where their virtual directories are kept. THis code runs fine when run locally on the server.
I am trying to extend it so that it works remotely. The thing I'm struggling with getting it to authenticate. I'm currently using the LogonUser
api, but this always returns false on logon
- I know the credentials I have are good
- I don't have a firewall between me and the server
- If I run the app with out the
LogonUser
API call and user runas from the command line I get the error:COMException (0x80005000)
Any thoughts would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,如果您在远程服务器上执行编程管理,您会将凭据传递给 API。例如,如果您使用 System.DirectoryServices,那么您需要执行以下操作:
Normally if you're performing programmatic administration on a remote server you'd pass the credentials to the API. For example if you're using
System.DirectoryServices
then you'd do: