如何检查系统中是否安装了Exchange Server [英] How to check whether exchange server is installed in a system

查看:190
本文介绍了如何检查系统中是否安装了Exchange Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#检查系统中是否安装了Exchange Server.

谢谢

How we can check whether exchange server is installed in a system using c#.

Thanks

推荐答案



您可以轻松地使用WMI来读取Exchange服务器的版本.

Hi,

you could easily use WMI to read version of your exchange server.

string search_term = "Vendor LIKE 'Microsoft%' AND Name = 'Exchange'";
string[] properties = new string[]{ "Version" };
SelectQuery query = new SelectQuery("Win32_Product", search_term, properties );
using (ManagementObjectSearcher search_product = new ManagementObjectSearcher(query))
using (ManagementObjectCollection products = search_product.Get())
  foreach (ManagementObject product in products)
  {         
      //save version
      string version = (string) product["Version"]; 
  } 
}



Microsoft的WMI-Tools是一个很好的帮助器:
http://www.microsoft.com/download/en/details.aspx?id=24045 [ ^ ]

致以最诚挚的问候



Microsoft''s WMI-Tools is a great helper:
http://www.microsoft.com/download/en/details.aspx?id=24045[^]

With Best Regards


不知道为什么上面的代码无法正常工作. 产品中的商品计数为零.我的系统配置是否有任何问题,
Don''t know why the above code is not working. Item count in Products is zero. Will there be any issues with my system configuration,.


这篇关于如何检查系统中是否安装了Exchange Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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