Skip to Main Content
Programming SQL Server 2005
book

Programming SQL Server 2005

by Bill Hamilton
February 2006
Intermediate to advanced content levelIntermediate to advanced
586 pages
17h 35m
English
O'Reilly Media, Inc.
Content preview from Programming SQL Server 2005

Chapter 13. Programming Windows Management Instrumentation (WMI)

You view and manage SQL Server services, network settings, and server-alias settings using the Windows Management Instrumentation (WMI) Provider for Configuration Management. The ManagedComputer class in the Microsoft.SqlServer.Management.Smo.Wmi namespace represents a WMI installation on a SQL Server instance. It provides access to the WMI Provider for Configuration Management.

The ManagedComputer class is the top class in the SMO WMI hierarchy, just as the Server class is the top class in the SMO instance classes. ManagedComputer objects operate independently of Server objects.

You can use the WMI Provider for Configuration Management in one of three ways:

  • Use a Windows Management Instrumentation Query Language (WQL) editor or query tool such as WBEMTest.exe to execute queries.

  • Use a scripting language such as VBScript, JScript, or Perl in which you can embed and execute WQL queries.

  • Use the ManagedComputer class in the Microsoft.SqlServer.Management.Smo.Wmi namespace from a .NET SMO application.

This book deals only with using the ManagedComputer class in a .NET SMO application. For more information about the other alternatives, see Microsoft SQL Server 2005 Books Online.

Programming SMO WMI Classes

Figure 13-1 shows the relationship between SMO classes used with the WMI Provider for Configuration Management.

This section shows how to programmatically use SMO WMI classes. The examples in this section are all built using ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Microsoft® SQL Server® 2012

Programming Microsoft® SQL Server® 2012

Leonard Lobel and Andrew Brust

Publisher Resources

ISBN: 0596004796Supplemental ContentErrata Page