IWMIExtension::GetWMIServices method

The GetWMIServices method of IWMIExtension returns a WMI services object for the root\cimv2 namespace. You can then use this object to get other objects in the namespace, execute methods, and invoke WMI queries.

Note  For more information about support and installation of this component on a specific operating system, see Operating System Availability of WMI Components.

Syntax

HRESULT GetWMIServices(
  [out]  ISWbemServices **ppWMIServices
);

Parameters

  • ppWMIServices [out]
    A WMI services object that use in the root\cimv2 namespace to perform other WMI actions. If this parameter is NULL, the method returns wbemErrInvalidParameter (0x80041008).

Return value

An HRESULT object that contains the status of the method call.

This method may return errors associated with SWbemLocator.ConnectServer.

Remarks

This is a dual-language interface. You must query the ADSI object for the IWMIExtension interface before use this method. For more information about how to use the dual interface with C++, see Automation Interfaces.

Examples

For C++ code examples, see WMI C++ Application Examples.

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

End of client support

Windows XP

Header

Wbemuuid.h

Library

Wbemuuid.lib

Type library

Wbemadsi.tlb

DLL

Wbemads.dll

See also

Accessing a Remote WMI Win32_ComputerSystem Object Path