We have code to identify instances of SQL Server and their associated report server instances that return unexpected results.
The machine has two instances SQL Express (2008) - (local)/SQLEXPRESSand (local)/EXPRESS_BOB- each with its own report server.
Using WMI, we identify instances of SQL Server, and this works as expected. For each instance, we then request RS instances as follows:
public void QueryServers(string wmiPath)
{
using (
var searcher = new ManagementObjectSearcher(
wmiPath,
"Select * from MSReportServer_ConfigurationSetting"))
{
ManagementObjectCollection moc = searcher.Get();
}
}
This is done for two wmiPath values (note - Run as Admin required):
- 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 , ( ), ?
?