惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Vercel News
Vercel News
博客园_首页
Y
Y Combinator Blog
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
博客园 - Franky
Engineering at Meta
Engineering at Meta
量子位
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
N
Netflix TechBlog - Medium

博客园 - yzx99

哈希表用于Key与Value的对应 一次让代码更适应变化的经历(续) 一次让代码更适应变化的经历 错误提示与实际问题不符合的案例之一 C#中控件数组的讨论 C#下水晶报表打印自定义纸张 设计模式应用之一:控件清空 自定义StyleCop规则 恢复数据工具比较 SQL公式一直设不成功 不把text或image字段放最后的后果 要显示ASP调试信息,要把IE友好错误去掉 WMI的几种写法 - yzx99 - 博客园 计算机重启脚本 - yzx99 - 博客园 VB6设置进度条颜色 - yzx99 - 博客园 判断ListView双击了子项,并获取其位置与大小 VB6实现ListView各行间隔颜色 - yzx99 - 博客园 SQL查询优化一小例 让普通用户查询安全日志
WMI代码运行错误:80041003
yzx99 · 2009-04-15 · via 博客园 - yzx99

今天要在192.168.0.3上面使用WMI做读取安全日志的功能,但使用WMI时,遇到下马威:
执行以下代码出错:
錯誤 '80041003'
/2.asp, 列11
先是在本机中正常,远程电脑不行,然后我在IIS中关闭匿名,这样,只能输入超级用户可以实现显示服务器的IP,但普通用户就不行了。
最后找到WMI的属性中有一个“安全”页签,对其中的cimv2进行设置——允许everyone遠端啟用,然后就正常了,即使匿名也行。

<%@ LANGUAGE="VBSCRIPT"%>
<HTML>
<HEAD>
<TITLE>WMI ASP Example:
    Read Default Gateway and IP Address information </TITLE>
</HEAD>

<BODY>

<%
set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}\\.\root\cimv2")
set IPConfigSet = objWMIService.ExecQuery("SELECT IPAddress, DefaultIPGateway FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=TRUE")

for each IPConfig in IPConfigSet
  if Not IsNull(IPConfig.IPAddress) then
    for i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)%>
<p> IP Address: <%=IPConfig.IPAddress(i)%></p>
<%  next
  end if

  if Not IsNull(IPConfig.DefaultIPGateway) then
    for i=LBound(IPConfig.DefaultIPGateway) to UBound(IPConfig.DefaultIPGateway)%>
<p> Default IP Gateway: <%=IPConfig.DefaultIPGateway(i)%></p>
<%  next
  end if
next%>

</BODY>
</HTML>