使用WMI查询检查是否已安装IIS [英] Check whether IIS is installed or not using WMI query

查看:80
本文介绍了使用WMI查询检查是否已安装IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

有没有一种方法可以在远程计算机中使用WMI查询来检测是否已安装IIS.

感谢

Hello,

Is there a way to detect whether IIS is installed or not using WMI query, in a remote machine.

Thanks

推荐答案

下面的WMI脚本列出了IIS目录.如果没有任何输出,则结果是MyMachine没有安装IIS.

中的每个项目
Below WMI script lists IIS directories. If you don''t have any output, then the result is that MyMachine doesn''t have IIS installed.

for each item in GetObject("winmgmts://MyMachine/root/MicrosoftIISv2").ExecQuery("SELECT * FROM IIsWebVirtualDir" )
  WScript.Echo item.name
next


这篇关于使用WMI查询检查是否已安装IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆