Hi. I've successfully used WMI to get instances of MSSQL_SQLServer running on a server, but I'm having trouble getting a specific instance.

The documentation says that it is possible to ask for a specific instance of a class in WMI rather than using enumeration. But the examples provided are using VB GetObject().

The code below is successful:

wmiNamespace = @"\\.\root\MicrosoftSQLServer";
wmiSQLServerClass = new ManagementPath(@"\\.\root\MicrosoftSQLServer:MSSQL_SQLServer");
ManagementScope objManagementScope = new ManagementScope(wmiNamespace);

// Connect to the SQLServer Namespace.
objManagementScope.Connect();
objServerClass = new ManagementClass(wmiSQLServerClass);

At this point I can use
objServerClass.GetInstances();

But I'm lost when it comes to getting the specific instance I want.

Thanks!

--------------------------------
From: Ticean Bennett

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>qQ+NKlOpWkOSvzn4Fu2qzg==</Id>