报告服务实例的WMI查询返回所有实例,而不管父SQL服务器路径。

5
我们有一些用于识别SQL Server实例及其相关的Reporting Server实例的代码,但返回的结果与预期不符。
某台机器上有两个实例:SQL Express (2008) - (local)/SQLEXPRESS(local)/EXPRESS_BOB,每个实例都有自己的Reporting Server。
使用WMI,我们可以识别SQL Server实例,并且这部分工作正常。对于每个实例,我们按照以下方式查询RS实例:
public void QueryServers(string wmiPath)
{
    using (
        var searcher = new ManagementObjectSearcher(
           wmiPath, 
           "Select * from MSReportServer_ConfigurationSetting"))
    {
        ManagementObjectCollection moc = searcher.Get();
        //
        // Process objects in moc
        //
    }
}

以下是针对两个不同的 wmiPath 值的运行结果(注意 - 需要以管理员身份运行):

  • wmiPath = "root\Microsoft\SqlServer\ReportServer\RS_SQLEXPRESS\v10\Admin"
  • wmiPath = "root\Microsoft\SqlServer\ReportServer\RS_EXPRESS_5fBOB\v10\Admin"

无论 wmiPath 的值为何,moc 集合始终包含 两个 值:

  • moc[0] ["InstanceName"] = "SQLEXPRESS"
  • moc[1] ["InstanceName"] = "EXPRESS_BOB"

查询指定 SQL Server 实例的 WMI 路径下的内容,为什么返回的 Report Server 实例(我期望它们)在不同的路径下呢?

这是否是正确的查询路径?


请查看以下链接...解释了如何查询报告服务实例信息...检查您的注册表...尝试使用解决方法。http://nocentdocent.wordpress.com/2010/07/03/sccm-how-to-force-sql-reporting-services-point-to-select-a-specific-srs-instance-on-a-machine-with-multiple-instances-an-unsupported-workaround/.... http://magalhaesv.wordpress.com/2012/05/24/system-center-configuration-manager-x-sql-server-reporting-services-x-wmi-english-version/ - Colin Smith
1个回答

3

非常好 - 这正是我需要的答案。谢谢 user1578107。 - Neil Moss

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接